Send message
Overview
This command allows you to send one or more SMS messages. To send messages to your database of mobile numbers, you can call this command in a loop.
The server will respond with a unique identifier for each message (referred to as an API message ID). This API message ID can be used to track and monitor the status of your 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 all handsets.
For high volume messaging, we encourage the use of persistent (keep-alive) HTTP/S
connections. Multiple concurrent HTTP/S
connections may also be used for additional performance.
POST https: //api.clickatell.com/rest/message |
Note: the REST API may respond with various HTTP status codes. See the full list here.
JSON
Request
POST /rest/message HTTP/ 1.1 HOST: api.clickatell.com X-Version: 1 Content-Type: application/json Authorization: Bearer [Your Authorization Token] Accept: application/json { "text" : "Test Message" , "to" :[ "2799900001" , "2799900002" ]} |
Response
HTTP/ 1.1 202 Accepted Content-Type: application/json { "data" :{ "message" :[ { "accepted" : true , "to" : "2799900001" , "apiMessageId" : "a55b8f8d56f33440e993aa614c68bf8b" }, { "accepted" : true , "to" : "2799900002" , "apiMessageId" : "7f1d32762f6db11f3b7d2aaca2aaf362" } ] } } |
XML
Request
1 |
|
Response
1 |
|
Sample code
cURL
to= "[\"<mobile number>\"]" message= "Test Message" authToken= "<place auth token here>" curl -X POST \ -H "X-Version: 1" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer $authToken" \ -d "{\"text\":\"$message\",\"to\":$to}" \ https: //api.clickatell.com/rest/message |
Python
1 |
|
PHP
1 |
|
Submit a Comment
Other Resources
Ask the Community
Visit Stack Overflow to join our community of developers and find the answer you need
Contact Support
Contact our support team and one of our agents will be in touch with you to answer any questions you have