Sending Messages (REST)
Up to 100 SMS messages may be batched into a single request, or, a single message to one or more of your Groups.
Send Options
While each of these methods of sending has its own distinct requests/requisites, they share common functionality in the form of Send Options. These options can be used to tailor the settings for messages in a request.
Bulk Message Request
The following is an example request to use the bulk messages resource:
POST /bulkmessages HTTP/1.1
HOST: rest.mymobileapi.com/v1
Content-Type: application/json
Authorization: Bearer [Your Authorization Token]
Accept: application/json
{
"Messages": [
{
"Content": "Hello John. Our new API is available. https://mymobileapi.readme.io/docs/rest to learn more",
"Destination": "27830000000"
}
]
}
Group Message Request
The following is an example request to use the groupmessages resource:
POST /groupmessages HTTP/1.1
HOST: rest.mymobileapi.com/v1
Content-Type: application/json
Authorization: Bearer [Your Authorization Token]
Accept: application/json
{
"Message": "Hello John. Our new API is available. https://mymobileapi.readme.io/docs/rest to learn more",
"Groups": [
"JohnGroupName"
]
}
Response:
HTTP/1.1 200 Accepted
Content-Type: application/json
{
"Cost": 1,
"RemainingBalance": 1500,
"EventId": 12345678901,
"Sample": "Hello John. Our new API is available. Go to https://mymobileapi.readme.io/docs/rest to learn more",
"Messages": 1,
"Parts": 1,
"CostBreakDown": [
{
"Network": "Local",
"Cost": 1,
"Quantity": 1
}
],
"ErrorReport": {
{
"NoNetwork": 0,
"Duplicates": 0,
"OptedOuts": 0,
"Faults": []
}
}
}
Post Paid Customers
Remaining Balance will always return a value of 1000000 on Post Paid accounts as no credit deduction occurs on this account type.
See the API Reference for more detailed information about:
- Sendoptions
- The bulkmessages resource
- The groupmessages resource
Updated over 4 years ago