SMS Alerts API
#
Whatsapp Alerts#
Twilio configuration in ShunyaConfig | 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 parametersFor example:
A typical Twilio configuration will look like this
#
APIAPI | Description | Details |
---|---|---|
newTwilio() | Create new Twilio Instance. | Read More |
sendWhatsappTwilio() | Send Whatsapp 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
sendWhatsappTwilio()
#
Description: Send Whatsapp 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 :