Short answer
Send SMS on SMSTAKE with an HTTPS GET to https://api.smstake.com/smsapi/httpapi.jsp using your API username and password, plus DLT fields from, pe_id, template_id and template-matching text. Store the returned ack_id for delivery reports. Full field tables live in the SMS API reference.
This guide shows working Node.js, Python and PHP examples for that HTTP API, how to read SMSTAKE error codes, and a short pre-production checklist. XML and JSON bulk endpoints are documented on the same reference page. For high-volume SMPP access, talk to the team during onboarding.
1. Authentication and endpoint overview
| Item | Value |
|---|---|
| Endpoint | GET https://api.smstake.com/smsapi/httpapi.jsp |
| Auth | Query parameters username and password (store them in environment variables) |
| Compulsory DLT fields | from (approved header), pe_id, template_id, text (must match the approved template) |
| Recipient | to - country code, no plus sign (for example 919876543210) |
| Useful options | coding (0 English / 2 Unicode), flash, responsetype=json |
RCS, Voice and WhatsApp APIs on api.smstake.com/v1/ use Bearer tokens. The SMS HTTP/XML/JSON pathways on this page use username and password. See the developer portal for channel-specific docs.
2. Code examples
Replace the sample OTP text with wording that matches your approved DLT template exactly. Keep credentials out of source control.
A. Node.js (fetch)
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}`
);
const body = await res.text();
console.log(body); // success includes ack_id; errors include error_code
B. Python (requests)
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)
C. PHP
$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;
Example responses
{
"status": "success",
"ack_id": "8f3k2j9x1m"
}
{
"status": "error",
"error_code": "010"
}
For one text to many numbers, or many different texts, use the JSON or XML bulk endpoints documented in the SMS API reference.
3. Error handling
When a request is rejected, parse error_code from the JSON body. Codes returned by the SMSTAKE SMS API include:
| Code | Meaning |
|---|---|
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 |
- DLT mismatches (
104/ related portal issues): compare the exacttextyou sent with the approved template, and confirmpe_idandtemplate_idon your operator DLT portal. Use typed variables such as{#numeric#}, not the old{#var#}- see the variable tagging guide. - Retries: retry only on network timeouts or transient failures. Do not blindly resend after a successful
ack_idunless your product logic needs a new message. Deduplicate with your own request id plus the gatewayack_id. - DLRs: pull reports with
dlrresp.jspor configure push webhooks. Patterns are in the DLR webhook integration guide.
4. Pre-production checklist
- Credentials loaded from environment variables, not committed to git
- Test sends use numbers you control; confirm any account-side test setup with SMSTAKE during onboarding
textmatches the approved DLT template character-for-character, including typed variable positionsfrom,pe_idandtemplate_idmatch your DLT portal, and the PE-TM chain includes SMSTAKE- You store
ack_idand can receive or pull delivery reports before go-live
Ready to integrate?
Use the full SMS API reference and Postman collections, or request a demo for guided API onboarding and free DLT registration support.
Request a Demo