send
SMS
USSD
LBS
The send call is used to send a text message (SMS message) to one or more mobile users.
URL: https://tms.flashmedia.co.za/api/sms/send
HTTP Method: POST
Input Parameters
destination- Comma-separated list of destination MSISDNs.
message- The text content of the SMS message.
validity_period- (Optional) The validity period for the message. The format for the validity period is: yyMMddHHmmss, where:
- yy - year
- MM - month
- dd - day of month
- HH - hour
- mm - minute
- ss - second
Data Returned
accepted- Whether or not the SMS messages were accepted for transmission. Possible values are
trueandfalse. batch_id- The unique ID that was assigned for this batch of SMS messages; returned during message status update callbacks. Not returned if "accepted" is "false".
batch_size- The number of mobile numbers the message was sent to. If TMS3 cannot send to any of the specified destinations, this value will be less than the number of destinations you specified.
receive_updates- Whether or not status updates will be sent.
remaining_credits- The number of outgoing SMS credits remaining in your TMS account.
error- (Optional) A string describing the error in case "accepted" was "false". Not included in response if "accepted" is "true".
Example API call using cURL
JSON
curl -X POST https://tms.flashmedia.co.za/api/sms/send \
-u 'username:password' -H 'Accept: application/json' \
-d 'destination=27820000001,27820000333,27830004444' -d 'message=Test SMS message'
XML
curl -X POST https://tms.flashmedia.co.za/api/sms/send \
-u 'username:password' -H 'Accept: application/xml' \
-d 'destination=27820000001,27820000333,27830004444' -d 'message=Test SMS message'
Example Successful Response
JSON
{
"batch_id" : 1108171120088969084,
"accepted" : true,
"remaining_credits" : 912,
"batch_size" : 3,
"receive_updates" : true
}
XML
<sms_send>
<batch_id>1108171120088969084</batch_id>
<accepted>true</accepted>
<remaining_credits>912</remaining_credits>
<batch_size>3</batch_size>
<receive_updates>true</receive_updates>
</sms_send>