SMS XML API — Bulk & Personalised Sending at Scale
Post a single XML document to send thousands of messages in one request — each with its own recipient, sender ID and personalised text. Built for high‑volume campaigns, per‑customer content and enterprise systems that already speak XML.
HTTP API or XML API?
Use the HTTP API when…
You send the same message to one or a few numbers — OTPs, alerts, simple triggers. One line of code per send. See HTTP API →
Use the XML API when…
You send different messages to many recipients in one shot — personalised campaigns, invoices, statements, mixed sender IDs and routes.
Base URL
POST an XML document with Content-Type: application/xml (or as a form field named data) to:
POST https://smsgatewayprovider.com/api/v3/sendsms/xml
XML structure
A single <MESSAGE> block holds your credentials once, then one <SMS> node per message. Set defaults at the top level and override per message where needed.
<!-- send different text to many recipients in one POST --> <MESSAGE> <AUTH username="acme" apikey="YOUR_API_KEY"/> <SMS> <SENDER>ACMEIN</SENDER> <ROUTE>2</ROUTE> <TYPE>0</TYPE> <TO>919876543210</TO> <TEXT>Hi Asha, your order 4821 has shipped.</TEXT> </SMS> <SMS> <SENDER>ACMEIN</SENDER> <ROUTE>2</ROUTE> <TO>919812345678</TO> <TEXT>Hi Ravi, your order 4822 is out for delivery.</TEXT> </SMS> </MESSAGE>
XML elements
| Element | Required | Description |
|---|---|---|
| <AUTH> | Yes | Credentials — username and apikey attributes. Sent once for the whole batch. |
| <SMS> | Yes | One message. Repeat this node for each recipient / body. Thousands per POST. |
| <SENDER> | Yes | Approved sender ID / header for this message. Can differ per <SMS>. |
| <ROUTE> | Yes | Route ID (transactional / OTP / promotional) for this message. |
| <TO> | Yes | Recipient in international format without + (e.g. 919876543210). |
| <TEXT> | Yes | Message body. Escape XML special characters (&, <) or wrap in <![CDATA[ … ]]>. Must match a DLT template for India. |
| <TYPE> | No | 0 = plain text (default), 2 = Unicode for regional languages. |
| <SCHEDULE> | No | Future send time YYYY-MM-DD HH:MM:SS for this message. |
Post the batch
cURL
curl -X POST https://smsgatewayprovider.com/api/v3/sendsms/xml \ -H "Content-Type: application/xml" \ --data-binary @batch.xml
PHP
$xml = file_get_contents('batch.xml'); $ch = curl_init('https://smsgatewayprovider.com/api/v3/sendsms/xml'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => $xml, CURLOPT_HTTPHEADER => ['Content-Type: application/xml'], CURLOPT_RETURNTRANSFER => true, ]); echo curl_exec($ch);
Response
<RESPONSE> <STATUS>success</STATUS> <BROADCAST_ID>1706donef4-2b9c-4d1a</BROADCAST_ID> <ACCEPTED>2</ACCEPTED> <REJECTED>0</REJECTED> </RESPONSE>
Each accepted message gets a delivery receipt you can pull from the DLR API using the broadcast ID.
XML API — frequently asked questions
How many messages can I send in one POST?
<SMS> nodes per POST) so retries stay cheap and you get responses quickly. Your account tier sets the throughput ceiling.Can each recipient get a different message and sender ID?
<SMS> node carries its own <TO>, <TEXT>, <SENDER> and <ROUTE>, so you can mix personalised content and multiple headers in a single batch.How do I include special characters or emoji?
&, <, >) or wrap the text in a <![CDATA[ ]]> block. For emoji and regional languages set <TYPE>2</TYPE> (Unicode) and encode the document as UTF‑8.What happens if one message in the batch is invalid?
<REJECTED> with a reason. The batch does not fail as a whole, so a single bad number never blocks the rest of your campaign.Is DLT compliance handled the same way?
<TEXT> must match an approved DLT template tied to the sender header, exactly as with the HTTP API. We assist with entity, header and template registration.



