HTTP POST
POST /api/2013-12-01/SMS/[Agency ID]
You must POST at least the following to send an SMS.
Parameter | Description |
---|---|
Body | The SMS body. Formatted as plain text. |
From_Name | We’ll automatically append this to the end of your message. Minimum of 6 characters, maximum of 255 characters. |
User_ID | The ReadyOp User ID of the account that should be used to send the SMS. For audit and history purposes the sms will be logged as having been sent from this account inside ReadyOp. |
Additionally you must POST at a minimum either an array of Contacts and/or an array of Topics and/or an array of Objects.
Parameter | Description |
---|---|
Contacts | An array / list of all of the contacts you’d like to send an SMS to as well as their destination phone index. |
Objects | An array / list of all the object ids for which you’d like to send a notification. |
Topics | An array / list of all the topic names for which you’d like to send a notification. |
If you’re providing a list of contacts, each contact in the Contacts list should include the following fields:
Parameter | Description |
---|---|
Contact_ID | The contact’s unique Contact ID. |
Phone | The contact’s phone identifier/index. This can be obtained when pulling a contact’s information using the Get a Contact API request. |
Example Request
$ curl -XPOST https://[Site Name].readyop.com/api/2013-12-01/SMS/[Agency ID] \
-d "From_Name=John%Doe" \
-d "Body=This%20is%20just%20a%20test" \
-d "Contacts[0][Contact_ID]=1234" \
-d "Contacts[0][Phone]=0" \
-d "Topics[0]=test-topic \
-d "Objects[0]=4321 \
-u "[API Account ID]:[API Token]"
Request Result
{
"code": 0,
"status": 200,
"detail": "Success",
"timestamp": "2017-02-27T19:32:45+00:00",
"sms": {
"Thread ID": 820,
"Message ID": 3123
}
}