SMSLocal
XML API Reference

Send SMS with XML — for legacy and XML-centric stacks.

If your system speaks XML, you don't need to rewrite it. The SMSLocal XML API exposes the same endpoints as our HTTP API using clean, well-formed XML requests and responses — same credentials, same routing, same DLT guarantees.

Overview

The XML API is an alternative integration format for teams whose systems consume and emit XML natively — think legacy Java middleware, SOAP-based ERPs, or integration platforms that pipe XML through transformation layers. Every endpoint available on the HTTP API is also available here.

New integrations should prefer the HTTP / REST API. It is easier to test, documents better, and receives new features first. XML is maintained primarily for compatibility with older stacks.

When to use XML

Pick the XML API when any of the following applies to your environment.

  • Your middleware (Mule, BizTalk, WSO2, legacy ESB) already speaks XML end-to-end.
  • You need a schema-validated payload format for downstream audit or compliance.
  • You consume responses inside an application that parses XML natively — e.g. Oracle Forms, SAP PI/PO, or an on-prem Java EE stack.
  • You want to send several numbers in one request without constructing a JSON array.

Authentication

Authentication uses the same API key as the HTTP API. Place it inside a <credentials> block at the top of every request. Keys are 32-character hex strings and can be generated from Settings → API & Webhooks.

Keep your key server-side only. If a key is ever exposed in a repo, browser bundle, or log file, revoke and re-issue it immediately from the dashboard.

Send SMS

Submit a DLT-compliant message to one or more recipients in a single request. The response contains a messageid you use to fetch delivery reports later.

POST/api/xml/smsapi

Request body

ParameterTypeDescription
credentials.keyRequired
string
Your SMSLocal API key.
request.routeRequired
integer
1 for transactional (OTPs, alerts, 24x7, DND-exempt). 2 for promotional (marketing, 9am–9pm only, non-DND).
request.senderRequired
string
6-character DLT-registered header. Must belong to your Principal Entity.
Example: ALERTS
request.templateidRequired
string
DLT-approved template ID (19-digit). Content must match the approved template exactly.
Example: 1207161234567890123
request.numbers.numberRequired
string[]
One or more recipient numbers. Each number is a 10-digit Indian mobile number (6/7/8/9 prefix). Up to 50,000 numbers per request.
request.smsRequired
CDATA
Message body wrapped in CDATA so special characters (&, <, >, quotes) survive XML encoding.

Request example

xml
<?xml version="1.0" encoding="UTF-8"?>
<smslocal>
  <credentials>
    <key>YOUR_API_KEY</key>
  </credentials>
  <request>
    <route>1</route>              <!-- 1=transactional, 2=promotional -->
    <sender>ALERTS</sender>
    <templateid>1207161234567890123</templateid>
    <numbers>
      <number>9876543210</number>
      <number>9123456789</number>
    </numbers>
    <sms><![CDATA[Your OTP is 482913. Valid for 10 minutes.]]></sms>
  </request>
</smslocal>

Response

Success

xml
<?xml version="1.0" encoding="UTF-8"?>
<smslocal>
  <response>
    <status>success</status>
    <messageid>1987654321</messageid>
    <count>2</count>
  </response>
</smslocal>

Error

xml
<?xml version="1.0" encoding="UTF-8"?>
<smslocal>
  <response>
    <status>error</status>
    <code>110</code>
    <message>Invalid DLT Template ID</message>
  </response>
</smslocal>

Delivery report

Fetch per-recipient delivery status for a previously-sent batch using its messageid. For high-volume applications, configure a webhook on the dashboard and let us push reports to you instead.

POST/api/xml/dlrapi

Request body

ParameterTypeDescription
credentials.keyRequired
string
Your SMSLocal API key.
request.messageidRequired
string
The message ID returned when the batch was submitted via the Send SMS endpoint.
Example: 1987654321

Request example

xml
<?xml version="1.0" encoding="UTF-8"?>
<smslocal>
  <credentials>
    <key>YOUR_API_KEY</key>
  </credentials>
  <request>
    <messageid>1987654321</messageid>
  </request>
</smslocal>

Response

xml
<?xml version="1.0" encoding="UTF-8"?>
<smslocal>
  <response>
    <status>success</status>
    <reports>
      <report>
        <number>9876543210</number>
        <status>DELIVERED</status>
        <time>2026-04-20 14:21:08</time>
      </report>
      <report>
        <number>9123456789</number>
        <status>FAILED</status>
        <time>2026-04-20 14:21:12</time>
      </report>
    </reports>
  </response>
</smslocal>
Status values: DELIVERED, FAILED, PENDING, BLOCKED, EXPIRED. Reports are available for 30 days after submission.

Check credits

Retrieve your current balance for a specific route. Poll this before large campaigns or wire it into an internal monitoring dashboard so you top up before running out.

POST/api/xml/creditapi

Request body

ParameterTypeDescription
credentials.keyRequired
string
Your SMSLocal API key.
request.routeRequired
integer
1 for transactional balance, 2 for promotional balance.

Request example

xml
<?xml version="1.0" encoding="UTF-8"?>
<smslocal>
  <credentials>
    <key>YOUR_API_KEY</key>
  </credentials>
  <request>
    <route>1</route>
  </request>
</smslocal>

Response

xml
<?xml version="1.0" encoding="UTF-8"?>
<smslocal>
  <response>
    <status>success</status>
    <route>Transactional</route>
    <credits>48215</credits>
  </response>
</smslocal>

Error codes

Error codes are shared between the HTTP and XML APIs. When a request fails, the response will have <status>error</status> and a numeric code.

CodeNameMeaning
101Invalid userThe API key is missing, malformed, or revoked.
102Invalid sender IDSender is not registered on DLT under your PE.
103Invalid contact(s)One or more numbers are not valid Indian mobile numbers.
104Invalid routeRoute must be 1 (transactional) or 2 (promotional).
105Invalid messageMessage is empty, too long, or has disallowed characters.
106Spam blockedContent matched a spam pattern flagged by the operator.
107Promotional blockedRecipient is on the DND list for this category.
108Low creditsNot enough credits on the selected route.
109Promotional timingPromotional sends allowed 9:00 AM–8:45 PM IST only.
110Invalid DLT Template IDTemplate ID does not match an approved template.
111No SMSCNo operator route currently available. Retry with backoff.

See the HTTP API reference for full error-code fixes and remediation tips — they apply identically to the XML API.

Migration to REST

Teams that migrate from XML to REST typically save 30–50% on integration code and gain access to newer features like idempotency keys, streaming delivery reports, and native SDK support. Here is the quick mapping:

XML endpointREST equivalent
POST /api/xml/smsapiGET /api/smsapi
POST /api/xml/dlrapiGET /api/dlrapi
POST /api/xml/creditapiGET /api/creditapi

Ready to move to REST?

Our solutions engineers can review your XML payloads and ship a REST adapter alongside your existing integration so you cut over with zero downtime.

Same API. Whichever format your stack prefers.

Grab a key, pick REST or XML, and start sending. \u20B960 free credit on every new account.