We also offer a bulk XML interface for sending different messages to multiple recipients in bulk. This option is perfect for mail-merging text. We recommend no more than 500 tags in each submission.
https://api.textlocal.in/xmlapi.php
<?php $xmlData = ' <SMS> <Account apikey="Your apiKey" Test="0" Info="1" JSON="0"> <Sender From="Site 3" Sched="2012-01-21-14-59-00" rcpurl="http://yourdomain/yourreceiptscript.123"> <Messages> <Msg ID="15" Number="918123456789"> <Text>Message1</Text> </Msg> <Msg ID="16" Number="918987654321"> <Text>Message2</Text> </Msg> </Messages> </Sender> </Account> </SMS>'; $post = 'data='. urlencode($xmlData); $url = "https://api.textlocal.in/xmlapi.php"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST ,1); curl_setopt($ch, CURLOPT_POSTFIELDS ,$post); curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); $data = curl_exec($ch); curl_close($ch); echo $data; ?>
Caution: Some users opt to place their request inside a code loop, while testing we highly recommend setting the test parameter to true, as occasionally an infinite loop can occur and users can consume all their credits very quickly.
Test | Set to 1 to send the XML in test mode - no SMS will actually be transmitted |
---|---|
Info | Set to 1 to receive a response from our servers with details about your request. |
JSON | Receive the information above in JSON structured format. |
Number | The destination mobile phone number of the message - max 12 digits. |
Sender | Use this field to specify the sender name which is pre-approved by DLT and Textlocal.
|
Text | The message content. This parameter should be no longer than 918 characters. See Helpful Information for message length details. The message also must be URL Encoded to support symbols like &. |
Login Parameters (Additional Information) | |
apiKey | You can create these in your Messenger Control Panel (click here) for each application, and limit the usage of them by host IP Address. |
Optional Parameters | |
From | The FROM address of the message up to 6 alphanumeric characters. |
Sched | A scheduled delivery time for the message in (2012-01-21-14-59-00) format. We recommend not using this parameter, and despatch the messages live from your servers when required. |
rcpurl | Set a delivery receipt URL for this batch of messages. All delivery confirmation receipts will be POSTed to this URL. |
ID | A unique identifier for each message that will be displayed n your web reports, and/or POSTed back in the delivery receipt URL. |
* Post your requests to https://www.textlocal.in/xmlapi.php
* Use 1 'SMS' tag per submission
* Each message should be contained in a 'Msg' tag
* If necessary, specify the custom ID in the 'ID' property
* If necessary, specify a receipt notification URL in the 'rcpurl' property