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
| Item | Where to get it |
| API key | Your SMSGatewayHub panel after you register |
| Approved sender ID | A 6-character header registered on DLT |
| Approved template | The exact message text registered on DLT; see DLT registration |
| Route ID | Shown in your panel for your account |
| Any HTTP client | PHP, 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
| Parameter | Meaning |
| APIKey | Authenticates your account |
| senderid | Your approved sender ID |
| channel | 1 = promotional, 2 = transactional |
| DCS | 0 = normal text, 8 = Unicode (Hindi and other scripts) |
| flashsms | 0 = normal SMS, 1 = flash SMS |
| number | Mobile number with country code; up to 100 comma-separated |
| text | Message text matching your DLT template |
| route | Route 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.
Frequently Asked Questions
What is SMS API integration?
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.
How do I integrate an SMS API?
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.
Which programming languages are supported?
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.
How many numbers can I send to in one API call?
Up to 100 comma-separated mobile numbers per SendSMS request. For larger lists, send several requests in batches.
How do I get delivery reports through the API?
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.
Do I need DLT registration to use an SMS API in India?
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.