11 November 2016

REST API: Send message

11 November 2016
clock
1 minute

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 HTTPS request (up to 200 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/messages

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": "2017-02-27T14:30:00+0200",
"userDataHeader": "0605040B8423F0",
"validityPeriod": 1,
"charset": "UTF-8"
}

Response


202 Accepted
Content-Type: application/json
{
"messages": [
{ "apiMessageId": "af750c2dc53e4e4c88c39b3b48756d3a", 
"accepted": true, 
"to": "1234567980", 
"errorCode": null, "error": null, "errorDescription": null 
},
{
"apiMessageId": "abcdec2dc53e4e4c88c39b3b48756d3a", 
"accepted": true, 
"to": "09876543210", 
"errorCode": null, "error": null,
"errorDescription": null 
}
],
"errorCode": null,
"error": null,
"errorDescription": 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>380671234567</From>
<Binary>false</Binary>
<ClientMessageId>id</ClientMessageId>
<ScheduledDeliveryTime>2017-02-27T14:30:00+0200</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>

Featured Insight Circle post

Tracking Billions of Devices at the Edge

Related blogs posts

10 Mobile Marketing Strategies That Drive Traffic
Want Better Relationships with your Customers? Add Chat

About Clickatell

About Clickatell
We create a better world through technology, making commerce in chat accessible for everyone, everywhere. Consumers can now connect with brands to find goods and services, make purchases, track orders, and resolve issues with a simple text or chat. No need for cash, phone calls, in-person interactions, or apps. Founded in 2000 with now over 10,000 customers, Clickatell is powering the digital commerce transformation. Clickatell is headquartered in Silicon Valley, CA and has offices in Canada, South Africa, and Nigeria (www.clickatell.com).

Read more about Clickatell

Related blogs posts

10 Mobile Marketing Strategies That Drive Traffic
Want Better Relationships with your Customers? Add Chat

This website uses cookies to allow us to see how the site is used. The cookies cannot identify you. If you continue to use this site we will assume that you are happy with this. If you want to use the site without cookies or would like to know more, you can do that here.