The response from the API changes depending on whether you sent a single message or a batch of messages.
Single submission response
Successful submission
Upon a successful send to the Enterprise Communications API you receive a HTTP 201 and a JSON body in the following format:
Property | Type | Description |
---|---|---|
messageId | string | Unique ID for this message. |
sentOn | string | Date/time, in UTC, ISO 8601 format, that the message sent was accepted. |
status | string | One of: - processing - failed - sent |
statusDetails | object | Specific details related to the current status. |
_createdOn | string | Date/time, in UTC, ISO 8601 format, that the message was created. |
_createdBy | string | The profile ID that created the message. |
_updatedOn | string | Date/time, in UTC, ISO 8601 format, that the message was last updated. |
_updatedBy | string | The profile ID that last updated the message. |
{
"_createdOn": "2017-03-17T14:22:40.633Z",
"_updatedOn": "2017-03-17T14:22:40.633Z",
"_createdBy": "access:3dd1558a-9db3-406a-8460-cbe5100a7628",
"_updatedBy": "access:3dd1558a-9db3-406a-8460-cbe5100a7628",
"to": {
"phoneNumber": "447123123123"
},
"senderProfileId": "M0rsy",
"body": "I love Comapi",
"rules": [
"sms"
],
"sentOn": "2017-03-17T14:22:40.627Z",
"channelOptions": {
"sms": {
"from": "Comapi",
"allowUnicode": false
}
},
"status": "processing",
"statusDetails": {
"channelId": "sms"
},
"messageId": "d8e296bb-97c4-4495-b98f-1e32e0b11628"
}
Failed submission
If there are issues with the submitted request, a HTTP 400 is returned with the body describing the validation errors.
Get the final status for a message
Once submitted we process your message and try to deliver it down one of the channels specified. It is still possible that the message can fail at this stage if no channels accept the message. To find the final status of a message you can query it using the Get Status method, or register a webhook to have data pushed to your systems.
Batch submission response
Successful submission
On successful send to the Enterprise Communications API you receive a HTTP 202 and a JSON body. The JSON is an array of objects in the following format, one for each message submitted in the batch:
Property | Type | Description |
---|---|---|
index | int | The index of the message send request in the original batch submission that this response is for. |
messageId | string | The unique identifier for the message. This ID can be used to request status details and correlate inbounds and receipts to the original message. |
After sending a batch of messages
The messages are processed as fast as possible after submission, but it can take a few seconds before this process is finished and the message is available for status updates. You can get updates on your messages statuses asynchronously using our webhooks system.
[
{
"index": 0,
"messageId": "58bde0da-b380-4cb2-8dd1-ca74fc7a0cda"
},
{
"index": 1,
"messageId": "0aee96a8-09c9-4192-bf6d-c5f20a323956"
}
]
Failed submission
If there are issues with the submitted request a HTTP 400 is returned with the body describing the validation errors.