Skip to content
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

With kalkun v0.8 (JSONRPC 2.0)

(since https://github.com/kalkun-sms/Kalkun/commit/cd206521d90e1eeb4fb6121570ddac6d586a9f76)

RESTClient usage:

  • 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"}}

Json query with curl example:

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"}

With kalkun v0.7.1 (JSONRPC 1.1)

RESTClient usage:

  • Method: POST
  • URL: http://kalkun-url/index.php/plugin/jsonrpc/send_sms
  • Body: {"method":"sms.send_sms", "params":{"phoneNumber":"+1234","message":"Testing JSONRPC"}}

How to enable/disable it?

This is a plugin:

  • To enable, install the plugin in Kalkun
  • To disable, uninstall the plugin in Kalkun
Clone this wiki locally