SMS Alerts API
SMS Alerts#
Twilio configuration in Shunya#
| Config | Description |
|---|---|
| Account SID | Account SID from the Twilio console |
| Auth Token | Authorization Token from the Twilio console. |
The configurations need to be set manually by the user before using the API's
For example:
A sample JSON snippet should contain
Commonly configured parameters#
For example:
A typical Twilio configuration will look like this
API#
| API | Description | Details |
|---|---|---|
newTwilio() | Create new Twilio Instance. | Read More |
sendSmsTwilio() | Send SMS Message via Twilio API. | Read More |
newTwilio()#
Description : Creates a new Twilio Instance
Parameters
name (char *)- Name of the JSON object.
Return-type : twilioObj
Returns : twilioObj Instance for Twilio
Usage :
For example: Lets say your /etc/shunya/config.json JSON file looks like
So the usage of the API's will be
sendSmsTwilio()#
Description: Send SMS Message via Twilio API.
Parameters
obj(twilioObj) - the Twilio Instance Object.from_number(int) - the sending (Number in your Twilio account).to_number(int) - the Receiving mobile number.msg(char *) - the msg to be sent.
Return-type : int8_t
Returns: 0 on Success and -1 on Failure.
Usage :