Send Batch Transactional SMS
Call this endpoint using a POST request to send multiple SMSs using the details provided in the body.
Endpoint
| Method | URL | Parameters |
|---|---|---|
| POST | https://[Your URL]/api/2.0/production/sms/batch | [Your URL] – Your Everlytic Install URL, e.g. live1.everlytic.net |
Request Body
{
"data": [
["27833000123”, "hello world", "custom_id_1"],
["27829000789", "hello planet", "custom_id_2"]
]
}
Properties
| Property | Description | Data type | Required |
|---|---|---|---|
| data | Array to contain each individual SMS. | Array | Yes |
| Field 1 | Mobile number for message to be sent to. Must be a valid SA number | string | Yes |
| Field 2 | Content of SMS. Maximum 459 characters. | string | Yes |
| Field 3 | Your custom ID assigned to this SMS transaction. | string | No |
Example Request
curl --location 'https://live0.everlytic.net/api/2.0/production/sms/batch'
--data '{
"data": [
["27833000123”, "hello world", "custom_id_1"],
["27829000789”, "hello planet", "custom_id_2"]
]
}'
Response
Status codes
| Status | Explanation |
|---|---|
| 200 OK | Request received successfully. Does not mean all messages were successfully sent. |
| 401 Unauthorized | Invalid or missing authentication credentials. |
Properties
| Property | Description | Data type | Parameters |
|---|---|---|---|
| failures | Array containing the details of any failed messages. | Array | |
| mobile_number | The mobile number the message was intended for. | string | |
| error | The field responsible for the error | Array |
|
|
Present if the error was caused by the mobile number | Array | Array contains string with failure reason |
|
Present if the error was caused by the message body. | Array | Array contains string with failure reason |
| error_code | Code associated with the reason for failure. | string |
|
| custom_id | The custom ID that was set during sending. | string | Empty string if not provided |
Example responses
All messages successful [200 OK]
{
"failures": []
}
At least one message failed [200 OK]
{
"failures": [
{
"mobile_number": "23",
"error": {
"mobile_number": [
"The mobile number must be at least 9 characters."
]
},
"error_code": "01",
"custom_id": ""
},
{
"mobile_number": "27830001234",
"error": {
"message": [
"The message field is required."
]
},
"error_code": "01",
"custom_id": "custom_id_2"
}
]
}
Invalid/Missing credentials [401 Unauthorized]
"Invalid credentials."