💬 WhatsApp API @ Best Rate | Zero Setup Fee → 99.9% Uptime OTP Delivery — Try FREE Demo! 🏆 10,000+ Registered Businesses — 2,000+ Enterprise Clients Served 🚀 API Integration in Under 5 Minutes 🏅 Verified Business Badge with RCS Messaging 💬 WhatsApp API @ Best Rate | Zero Setup Fee → 99.9% Uptime OTP Delivery — Try FREE Demo! 🏆 10,000+ Registered Businesses — 2,000+ Enterprise Clients Served 🚀 API Integration in Under 5 Minutes 🏅 Verified Business Badge with RCS Messaging
Talk to Sales: India 1800 102 1822

SMS API Integration: A Step-by-Step Guide

Connect your app, website, CRM or ERP to an SMS gateway and send OTPs, alerts and campaigns from your own code. This guide walks through one real request from start to delivery report.

HTTP / HTTPS APIJSON responsesDelivery reportsSDKs and SMPP
Since 2009SMS gateway in India
99.9%Uptime SLA
100Numbers per request
ISO 27001Certified platform

Quick Answer

SMS API integration connects your software to an SMS gateway so it can send messages automatically. With SMSGatewayHub you create an account, copy your API key, register your sender ID and templates on DLT, then call the SendSMS HTTP endpoint with the number and text. The JSON response returns a JobId you use to fetch delivery reports.

What you need before you start

ItemWhere to get it
API keyYour SMSGatewayHub panel after you register
Approved sender IDA 6-character header registered on DLT
Approved templateThe exact message text registered on DLT; see DLT registration
Route IDShown in your panel for your account
Any HTTP clientPHP, Python, Node.js, Java, C#, Go, Ruby or a no-code tool

Step 1: send your first SMS

A single HTTP GET call. Replace the placeholders and URL-encode the text.

HTTP GET
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=YOUR_API_KEY&senderid=ABCDEF&channel=2&DCS=0&flashsms=0&number=9198XXXXXXXX&text=YOUR_APPROVED_TEMPLATE_TEXT&route=1
ParameterMeaning
APIKeyAuthenticates your account
senderidYour approved sender ID
channel1 = promotional, 2 = transactional
DCS0 = normal text, 8 = Unicode (Hindi and other scripts)
flashsms0 = normal SMS, 1 = flash SMS
numberMobile number with country code; up to 100 comma-separated
textMessage text matching your DLT template
routeRoute ID from your panel

Step 2: read the JSON response

Response
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047",
 "MessageData":[{"Number":"9198XXXXXXXX","MessageId":"mvHdpSyS7UOs9hjxixQLvw"}]}

ErrorCode 000 means the request was accepted. Store the JobId and each MessageId; any other ErrorCode means the request was rejected, and the ErrorMessage says why (for example a wrong key or sender ID).

Step 3: get delivery reports

HTTP GET
https://www.smsgatewayhub.com/api/mt/GetDelivery?APIKey=YOUR_API_KEY&jobid=20047

The response lists each MessageId with its DeliveryStatus (for example Delivered) and DeliveryDate. Poll after sending, or see the delivery status in the panel under live delivery reports.

Example in Python and PHP

Python
import requests
r = requests.get("https://www.smsgatewayhub.com/api/mt/SendSMS", params={
    "APIKey": "YOUR_API_KEY", "senderid": "ABCDEF", "channel": "2", "DCS": "0",
    "flashsms": "0", "number": "9198XXXXXXXX",
    "text": "YOUR_APPROVED_TEMPLATE_TEXT", "route": "1"})
print(r.json()["JobId"])
PHP
$q = http_build_query(["APIKey" => "YOUR_API_KEY", "senderid" => "ABCDEF",
  "channel" => "2", "DCS" => "0", "flashsms" => "0", "number" => "9198XXXXXXXX",
  "text" => "YOUR_APPROVED_TEMPLATE_TEXT", "route" => "1"]);
$res = json_decode(file_get_contents("https://www.smsgatewayhub.com/api/mt/SendSMS?" . $q), true);

SMSGatewayHub also offers official SDKs for Node.js, Python, PHP, Java, .NET, Go and Ruby, and an SMPP API for very high volume. Find them in the API developer hub.

Best practices

Getting integration right

  • Keep the API key on your server; never put it in a mobile app or browser code.
  • Use HTTPS and restrict the key by IP where possible.
  • URL-encode the text, and keep it exactly as the DLT template, changing only the variable parts.
  • Send at most 100 numbers per request; batch larger lists, as described in how to send bulk SMS.
  • Use channel 2 (transactional) for OTPs and alerts, and channel 1 only for promotions sent between 9 am and 9 pm.
  • Log JobIds and retry on network errors, not on rejected requests.
  • Use DCS=8 for Unicode text; it fits 70 characters per SMS instead of 160.

Common integrations

OTP and login

Use the OTP API for sign-up and login codes.

Order and payment alerts

Trigger SMS from your store, billing or ERP events.

CRM campaigns

Send campaigns to CRM segments, and capture leads with a missed call number.

Frequently Asked Questions

SMS API integration means connecting your app, website, CRM or ERP to an SMS gateway through an API, so your software can send SMS and read delivery reports automatically without anyone using a panel.

Create an account, copy your API key, register your sender ID and templates on DLT, then call the SendSMS endpoint with the number and text from your code. Store the JobId from the response and use it to fetch delivery reports.

Any language that can make an HTTP request works, including PHP, Python, Java, Node.js, C#, Go and Ruby. SMSGatewayHub also provides official SDKs for Node.js, Python, PHP, Java, .NET, Go and Ruby.

Up to 100 comma-separated mobile numbers per SendSMS request. For larger lists, send several requests in batches.

Call the GetDelivery endpoint with your API key and the JobId returned by SendSMS. The response gives the delivery status and time for each message.

Yes. The API sends real commercial SMS, so your sender ID and message templates must be registered on DLT. Text that does not match an approved template is blocked by operators.

Send your first SMS from code today

Get your API key, DLT guidance and sample code, and go live in an afternoon.