-
Notifications
You must be signed in to change notification settings - Fork 130
Plugin: REST Api
Note: This is a plugin, you need to install it before use.
The REST API takes these parameters.
-
phoneNumber
(mandatory) : the recipient phone number in international format -
message
(mandatory) : your text message -
SenderID
(optional)
The fields have to be correctly URL-encoded. For example, the plus sign +
must be replaced by %2B
(otherwise +
is interpreted as a space character). Space character would have to be %20
.
URL for +123456
, would be:
http://kalkun-url/index.php/plugin/rest_api/send_sms?phoneNumber=%2B123456&message=testing
If you want to set a SenderID, add this additional parameter to the URL : &SenderID=
You can test this either by entering this URL in your browser, or by using curl
this way:
curl "http://kalkun-url/index.php/plugin/rest_api/send_sms?phoneNumber=%2B123456&message=test%20message"
It is possible to configure various elements of the REST Api plugin. Set the configuration in application/plugins/rest_api/config/rest.php
If the plugin is configured to use the database - which is the case if you use any of rest_enable_keys
, rest_enable_logging
, rest_enable_access
or rest_enable_limits
- be sure to:
- set
rest_database_group
to a value available inapplication/config/database.php
. For example if you store everything in the same database, it is likely you have to set it to the same value as the one of$active_group
inapplication/config/database.php
which by default iskalkun_mysql
. - create the tables in the database referenced by that
rest_database_group
. The SQL queries to create the tables are available inapplication/plugins/rest_api/config/rest.php
. - in case you choose custom names for the tables, update the value of the
*_table
fields as well.
This is a plugin:
- To enable, install the plugin in Kalkun
- To disable, uninstall the plugin in Kalkun