REST API: Send message

This command allows you to send one or more SMS messages. The server will respond with a unique identifier for each message. You can also send to multiple handsets in one single HTTP/S request (up to 600 messages). This is useful if you are sending the same message text to multiple handsets.

The base URL for all API call strings is: https://platform.clickatell.com

JSON

Request


POST /messages
Content-Type: application/json
Accept: application/json
Authorization: [Your Authorization Token]
{
"content": "string",
"to": [
"+380976543211",
"+380976543212"
],
"from": "380671234567",
"binary": false,
"clientMessageId": "uuid",
"scheduledDeliveryTime": "yyyy-MM-dd'T'HH:mm:ssZ",
"userDataHeader": "0605040B8423F0",
"validityPeriod": 0,
"charset": "UTF-8"
}

Response


202 Accepted
Content-Type: application/json
{
"messages": [
{
"apiMessageId": "77fb29998253415fa5d66971d519d362",
"accepted": true,
"to": "380976543211",
"error": null
},
{
"apiMessageId": "d2a7b3f2a72a4c798f3f385ee92ee5ce",
"accepted": true,
"to": "380976543212",
"error": null
}
],
"error": null
}

XML

Request


POST /messages
Content-Type: application/xml
Accept: application/xml
Authorization: [Your Authorization Token]
<?xml version="1.0"?>
<SendMessageRequest>
<Content>string</Content>
<To>+380685555555</To>
<From>string</From>
<Binary>true</Binary>
<ClientMessageId>id</ClientMessageId>
<ScheduledDeliveryTime>yyyy-MM-dd'T'HH:mm:ssZ</ScheduledDeliveryTime>
<UserDataHeader>0605040B8423F0</UserDataHeader>
<ValidityPeriod>1</ValidityPeriod>
<Charset>UTF-8</Charset>
</SendMessageRequest>


Response


202 Accepted
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<SendMessagesResponse>
<Messages>
<Message>
<ApiMessageId>174319bc027f45d989728093cc170107</ApiMessageId>
<Accepted>true</Accepted>
<To>380685555555</To>
</Message>
</Messages>
</SendMessagesResponse>