Send message
Note: This page requires that you are familiar with the Using the SOAP API page.
Overview
The sendmsg
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. If a message is rejected, an error will be returned.
For high-volume messaging, we encourage the use of persistent HTTP/S
connections (keep-alive). Multiple concurrent HTTP/S
connections may also be used for additional performance.
Command
sendmsg |
Parameters
In addition to authentication parameters, only to
and text
are required.
Parameter |
Required |
Description |
---|---|---|
to |
Yes |
The mobile number to which the message must be delivered. The number should be in international number format (i.e. no leading zeros or + symbol should be used). |
text |
Yes |
The text content of the message. Note that some characters take up two character spaces due to GSM encoding standards. |
msg_callback |
No |
Enable message delivery status updates to be sent to your server via an HTTP request. See Callback. |
Many more parameters are available and listed in the send message parameters page.
Note: For compatibility purposes, the callback parameter is named msg_callback
(unlike our other APIs). This is because callback
is a built-in parameter in certain versions of Visual Studio.
Examples
All examples below are for the document/literal based server.
Send to two mobile numbers:
1 |
|
Send a Unicode message:
1 |
|
Send a flash message:
1 |
|
Send a binary message:
1 |
|
Use callback and sender ID:
1 |
|
Code Samples
PHP
1 |
|
API Responses
Example response – Sending to two handsets
Successful API response:
1 |
|
Error response:
1 |
|
Return format – Single number submission
Successful API response:
ID: <message ID> |
Error response:
ERR: <error code>, <error description> |
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