-
Notifications
You must be signed in to change notification settings - Fork 130
Plugin: JSONRPC
tenzap edited this page Mar 9, 2022
·
2 revisions
Note: This is a plugin, you need to install it before use.
For testing you may use RESTClient available as a browser extension.
Kalkun 0.8 uses JSONRPC 2.0
Kalkun 0.7.1 and before uses JSONRPC 1.1
(since https://github.com/kalkun-sms/Kalkun/commit/cd206521d90e1eeb4fb6121570ddac6d586a9f76)
- Method:
POST
- Custom Headers:
Content-Type: application/json
- URL:
http://kalkun-url/index.php/plugin/jsonrpc/send_sms
- Body:
{"jsonrpc":"2.0","id":551,"method":"sms.send_sms","params":{"phoneNumber":"+1234","message":"Testing JSONRPC"}}
Command:
curl -X POST -H 'Content-Type: application/json' -i 'http://localhost/kalkun/index.php/plugin/jsonrpc/send_sms' --data '{"jsonrpc":"2.0","id":551,"method":"sms.send_sms","params":{"phoneNumber":"+1234","message":"Testing JSONRPC"}}'
Output:
HTTP/1.1 200 OK
Date: ******
Server: Apache/2.4.51
Set-Cookie: kalkun_ci_session=*****; expires=*****; Max-Age=1209600; path=/; HttpOnly
Expires: ******
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Length: 52
Content-Type: application/json
{"jsonrpc":"2.0","id":551,"result":"Message queued"}
- Method:
POST
- URL:
http://kalkun-url/index.php/plugin/jsonrpc/send_sms
- Body:
{"method":"sms.send_sms", "params":{"phoneNumber":"+1234","message":"Testing JSONRPC"}}
This is a plugin:
- To enable, install the plugin in Kalkun
- To disable, uninstall the plugin in Kalkun