Overview
SMSTAKE exposes HTTP(S), XML and JSON messaging APIs on https://api.smstake.com. Use them to send transactional and promotional SMS for businesses in India. Every commercial SMS needs a DLT-approved sender ID (from), Principal Entity ID (pe_id) and content template ID (template_id). The message text must match the registered template.
| API | Method | Endpoint |
|---|---|---|
| HTTP / HTTPS GET | GET | https://api.smstake.com/smsapi/httpapi.jsp |
| XML, one text to many numbers | POST | https://api.smstake.com/mobxmlapi/xmlsmsapi.jsp |
| XML, many texts to many numbers | POST | https://api.smstake.com/mtplxmlapi/xmlsmsapi.jsp |
| JSON, one text to many numbers | POST | https://api.smstake.com/smsapi/jsonapi.jsp |
| JSON, many texts to many numbers | POST | https://api.smstake.com/smsapi/jsonapi_mtpl.jsp |
| Pull delivery report | GET | https://api.smstake.com/dirresponse/dlrresp.jsp |
Call the APIs over HTTPS. Store username and password in environment variables. URL-encode text on GET requests. Mobile numbers use the country code with no plus sign, for example 919876543210. Related guides: RCS API, SMSTAKE blog, DLT registration.
HTTP / HTTPS GET API
Endpoint: https://api.smstake.com/smsapi/httpapi.jsp?
Compulsory parameters
| Parameter | Description |
|---|---|
username | SMSTAKE API username |
password | SMSTAKE API password |
to | Recipient mobile number, or comma-separated numbers, with country code and no plus sign |
from | DLT-approved header (sender ID) |
text | Message text that matches the DLT template. URL-encode it |
pe_id | DLT Principal Entity ID |
template_id | DLT content template ID |
Optional parameters
| Parameter | Description |
|---|---|
coding | 0 for English text. 2 for Unicode |
scheduletime | Send later, in IST, as YYYY-MM-DD HH:mm:ss. Omit to send immediately |
flash | 0 for a normal SMS. 1 for a flash SMS |
responsetype | text, xml or json |
Request examples
curl "https://api.smstake.com/smsapi/httpapi.jsp?username=YOUR_USERNAME&password=YOUR_PASSWORD&from=SMSTKE&to=919876543210&text=Your%20OTP%20is%20482913&pe_id=YOUR_DLT_PE_ID&template_id=YOUR_DLT_TEMPLATE_ID&coding=0&flash=0&responsetype=json"
import os
import requests
resp = requests.get(
"https://api.smstake.com/smsapi/httpapi.jsp",
params={
"username": os.environ["SMSTAKE_USERNAME"],
"password": os.environ["SMSTAKE_PASSWORD"],
"from": "SMSTKE",
"to": "919876543210",
"text": "Your OTP is 482913",
"pe_id": os.environ["SMSTAKE_PE_ID"],
"template_id": os.environ["SMSTAKE_TEMPLATE_ID"],
"coding": "0",
"flash": "0",
"responsetype": "json",
},
timeout=30,
)
print(resp.text)
const params = new URLSearchParams({
username: process.env.SMSTAKE_USERNAME,
password: process.env.SMSTAKE_PASSWORD,
from: "SMSTKE",
to: "919876543210",
text: "Your OTP is 482913",
pe_id: process.env.SMSTAKE_PE_ID,
template_id: process.env.SMSTAKE_TEMPLATE_ID,
coding: "0",
flash: "0",
responsetype: "json"
});
const res = await fetch(`https://api.smstake.com/smsapi/httpapi.jsp?${params}`);
console.log(await res.text());
$query = http_build_query([
"username" => getenv("SMSTAKE_USERNAME"),
"password" => getenv("SMSTAKE_PASSWORD"),
"from" => "SMSTKE",
"to" => "919876543210",
"text" => "Your OTP is 482913",
"pe_id" => getenv("SMSTAKE_PE_ID"),
"template_id" => getenv("SMSTAKE_TEMPLATE_ID"),
"coding" => "0",
"flash" => "0",
"responsetype" => "json"
]);
$response = file_get_contents("https://api.smstake.com/smsapi/httpapi.jsp?" . $query);
echo $response;
Response
With responsetype=json, a successful submit returns an acknowledgement id. Store ack_id to match a later delivery report.
{
"status": "success",
"ack_id": "8f3k2j9x1m"
}
{
"status": "error",
"error_code": "010"
}
XML bulk APIs
POST the XML body with Content-Type: application/xml. The same account fields used on the HTTP API apply: username, password, from, text, pe_id and template_id.
Single SMS to multiple numbers
Endpoint: POST https://api.smstake.com/mobxmlapi/xmlsmsapi.jsp. One text is sent to every number inside to.
<?xml version="1.0" encoding="UTF-8"?>
<sms>
<username>YOUR_USERNAME</username>
<password>YOUR_PASSWORD</password>
<from>SMSTKE</from>
<text>Your OTP is 482913</text>
<pe_id>YOUR_DLT_PE_ID</pe_id>
<template_id>YOUR_DLT_TEMPLATE_ID</template_id>
<to>
<number>919876543210</number>
<number>919812345678</number>
</to>
</sms>
curl -X POST "https://api.smstake.com/mobxmlapi/xmlsmsapi.jsp" \
-H "Content-Type: application/xml" \
--data-binary @sms.xml
Multiple SMS to multiple numbers
Endpoint: POST https://api.smstake.com/mtplxmlapi/xmlsmsapi.jsp. Each message has its own to, text and template_id.
<?xml version="1.0" encoding="UTF-8"?>
<sms>
<username>YOUR_USERNAME</username>
<password>YOUR_PASSWORD</password>
<from>SMSTKE</from>
<pe_id>YOUR_DLT_PE_ID</pe_id>
<message>
<to>919876543210</to>
<text>Hi Ananya, your order ORD-1001 is out for delivery.</text>
<template_id>YOUR_DLT_TEMPLATE_ID</template_id>
</message>
<message>
<to>919812345678</to>
<text>Hi Rohan, your order ORD-1002 is out for delivery.</text>
<template_id>YOUR_DLT_TEMPLATE_ID</template_id>
</message>
</sms>
$xml = file_get_contents("sms.xml");
$ch = curl_init("https://api.smstake.com/mtplxmlapi/xmlsmsapi.jsp");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/xml"],
CURLOPT_POSTFIELDS => $xml,
CURLOPT_RETURNTRANSFER => true
]);
echo curl_exec($ch);
curl_close($ch);
JSON REST APIs
POST JSON with Content-Type: application/json. A successful body includes status and ack_id. An error body includes status and error_code.
Single SMS to multiple numbers
Endpoint: POST https://api.smstake.com/smsapi/jsonapi.jsp
{
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"from": "SMSTKE",
"text": "Your OTP is 482913",
"pe_id": "YOUR_DLT_PE_ID",
"template_id": "YOUR_DLT_TEMPLATE_ID",
"to": ["919876543210", "919812345678"]
}
const res = await fetch("https://api.smstake.com/smsapi/jsonapi.jsp", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
username: process.env.SMSTAKE_USERNAME,
password: process.env.SMSTAKE_PASSWORD,
from: "SMSTKE",
text: "Your OTP is 482913",
pe_id: process.env.SMSTAKE_PE_ID,
template_id: process.env.SMSTAKE_TEMPLATE_ID,
to: ["919876543210", "919812345678"]
})
});
console.log(await res.json());
import os, requests
resp = requests.post(
"https://api.smstake.com/smsapi/jsonapi.jsp",
json={
"username": os.environ["SMSTAKE_USERNAME"],
"password": os.environ["SMSTAKE_PASSWORD"],
"from": "SMSTKE",
"text": "Your OTP is 482913",
"pe_id": os.environ["SMSTAKE_PE_ID"],
"template_id": os.environ["SMSTAKE_TEMPLATE_ID"],
"to": ["919876543210", "919812345678"],
},
timeout=30,
)
print(resp.json())
Multi-to-multi JSON API
Endpoint: POST https://api.smstake.com/smsapi/jsonapi_mtpl.jsp
{
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"from": "SMSTKE",
"pe_id": "YOUR_DLT_PE_ID",
"messages": [
{
"to": "919876543210",
"text": "Hi Ananya, your order ORD-1001 is out for delivery.",
"template_id": "YOUR_DLT_TEMPLATE_ID"
},
{
"to": "919812345678",
"text": "Hi Rohan, your order ORD-1002 is out for delivery.",
"template_id": "YOUR_DLT_TEMPLATE_ID"
}
]
}
Response
{
"status": "success",
"ack_id": "8f3k2j9x1m",
"results": [
{ "to": "919876543210", "ack_id": "8f3k2j9x1m", "status": "success" },
{ "to": "919812345678", "ack_id": "8f3k2j9x1n", "status": "success" }
]
}
Delivery reports (DLR)
Pull DLR
Ask SMSTAKE for the latest status of a submitted message. Pass the ack_id from the send response as msgid.
Endpoint: GET https://api.smstake.com/dirresponse/dlrresp.jsp
| Parameter | Required | Description |
|---|---|---|
username | Yes | SMSTAKE API username |
password | Yes | SMSTAKE API password |
msgid | Yes | The ack_id returned when the SMS was accepted |
curl "https://api.smstake.com/dirresponse/dlrresp.jsp?username=YOUR_USERNAME&password=YOUR_PASSWORD&msgid=8f3k2j9x1m&responsetype=json"
{
"message_id": "8f3k2j9x1m",
"recipient": "919876543210",
"status": "DELIVERED",
"delivered_at": "2026-10-21T14:15:04+05:30",
"err_code": null
}
Push DLR webhook
Register an HTTPS callback URL on the SMSTAKE account. SMSTAKE posts each status change to that URL. Return 200 OK as soon as the event is stored. The posted body uses the same fields as the DLR webhook integration guide.
| Parameter | Description |
|---|---|
webhook_url | Your public HTTPS endpoint, configured in the SMSTAKE account |
X-SMSTAKE-Signature | Optional request header. When signing is enabled, it is sha256= plus the HMAC-SHA256 of the raw body |
message_id | The ack_id from the send response |
recipient | Mobile number the report belongs to |
status | Delivery status, such as SUBMITTED, DELIVERED or FAILED |
delivered_at | Time the status was recorded, ISO 8601 with the India offset |
err_code | null when there is no operator error. Otherwise the delivery error code |
POST https://yourapp.com/webhooks/smstake/dlr
Content-Type: application/json
X-SMSTAKE-Signature: sha256=<hex-encoded HMAC-SHA256 of the raw body>
{
"message_id": "8f3k2j9x1m",
"recipient": "919876543210",
"status": "DELIVERED",
"err_code": null,
"delivered_at": "2026-10-21T14:15:04+05:30"
}
Receiver patterns for Node.js and Python are in the DLR webhook integration guide.
Error codes
When a request is rejected, the response includes error_code. These are the codes returned by the SMSTAKE SMS API.
| Code | Description |
|---|---|
010 | Invalid username or password |
011 | Account expired or inactive |
15 | Invalid mobile number |
103 | Invalid sender ID (from) |
104 | Message text does not match the DLT template |
105 | Insufficient balance |