sign up and get 500 messages freeSign up free
Developers

SMS API Integration Guide: How to Send SMS from Your Website or App

Step-by-step SMS API integration guide for developers in India: how a REST/HTTP SMS API works, code in PHP, Node.js and Python, delivery reports, errors and DLT.

SMS API Integration Guide: How to Send SMS from Your Website or App – sms api integration guide by Bulk SMS India

An SMS API lets your website, app or CRM send SMS automatically: an OTP when a user logs in, a message when an order ships, a reminder before a payment is due. No one has to open a panel and click "Send".

This guide walks you through SMS API integration from start to finish, with working code in PHP, Node.js and Python using the Bulk SMS India HTTP API.

What is an SMS API?

An SMS API (Application Programming Interface) is a web address your code calls with a few parameters: who to send to, what to send and from which sender ID. The provider delivers the SMS and returns a message ID, which you can use later to check delivery.

Most Indian SMS APIs, including ours, are HTTP/REST style: a simple GET or POST request that works from any language. For very high volumes, providers also offer SMPP.

Infographic: SMS API integration – key takeaways from Bulk SMS India
SMS API integration: key takeaways

How SMS API integration works

Step What your system does
1 Builds the message from an approved DLT template
2 Calls the send endpoint with your username, API key, sender ID and numbers
3 Stores the message ID from the response
4 Checks the delivery report (DLR) or reads it in the panel

Before you start

  1. Create an account and get your username and API key from the panel.
  2. Register on DLT: entity, sender ID (header) and templates. See how to register SMS templates on DLT.
  3. Make sure your message text matches an approved template exactly.
  4. Keep your API key in an environment variable, never in front-end code.
Live preview

What your customer sees

  • DLT-approved sender ID and template
  • Submitted to operators in real time
  • Live delivery report for every number
  • Works on every mobile phone
Example SMS. Brand names are illustrations.

The send endpoint

Base URL: http://sms.bulksmsind.in

GET /sendSMS?username=YOUR_USERNAME&apikey=YOUR_API_KEY
    &sendername=BSMSIN&smstype=TRANS
    &numbers=9876543210&message=Your%20order%20%231001%20is%20confirmed.
Parameter Meaning
username Your panel username
apikey Your secret API key
sendername Your DLT-approved sender ID
smstype Route set for your account, such as TRANS
numbers One number, or a comma-separated list
message URL-encoded text that matches your DLT template

Full details, including scheduled and group SMS, are in the SMS API documentation.

Send SMS with cURL

curl -G "http://sms.bulksmsind.in/sendSMS" \
  --data-urlencode "username=YOUR_USERNAME" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  --data-urlencode "sendername=BSMSIN" \
  --data-urlencode "smstype=TRANS" \
  --data-urlencode "numbers=9876543210" \
  --data-urlencode "message=Your order #1001 is confirmed. - ShopIn"

Send SMS with PHP

<?php
$params = [
    'username'   => 'YOUR_USERNAME',
    'apikey'     => getenv('BSI_API_KEY'),
    'sendername' => 'BSMSIN',
    'smstype'    => 'TRANS',
    'numbers'    => '9876543210',
    'message'    => 'Your order #1001 is confirmed. - ShopIn',
];
$url = 'http://sms.bulksmsind.in/sendSMS?' . http_build_query($params);
echo file_get_contents($url); // contains the message ID

Send SMS with Node.js

const params = new URLSearchParams({
  username: 'YOUR_USERNAME',
  apikey: process.env.BSI_API_KEY,
  sendername: 'BSMSIN',
  smstype: 'TRANS',
  numbers: '9876543210',
  message: 'Your order #1001 is confirmed. - ShopIn',
});
const res = await fetch(`http://sms.bulksmsind.in/sendSMS?${params}`);
console.log(await res.text()); // contains the message ID

Send SMS with Python

import os, requests

params = {
    "username": "YOUR_USERNAME",
    "apikey": os.environ["BSI_API_KEY"],
    "sendername": "BSMSIN",
    "smstype": "TRANS",
    "numbers": "9876543210",
    "message": "Your order #1001 is confirmed. - ShopIn",
}
r = requests.get("http://sms.bulksmsind.in/sendSMS", params=params, timeout=15)
print(r.text)  # contains the message ID

Check delivery and balance

  • Delivery report: call /getDLR with your username, API key and the message ID.
  • Date-wise report: call /getDLRReport with a from and to date.
  • Balance: call /getSMSCredit to check remaining credits before a big campaign.

Best practices for a reliable integration

  • URL-encode the message, especially &, # and Hindi text.
  • Send from your server, never from the browser, so your API key stays private.
  • Set a timeout and retry once on network errors. Don't retry blindly, or users get two SMS.
  • Store the message ID with the order or user record for support queries.
  • Validate numbers: 10 digits for Indian mobiles; remove spaces and +91 if your account expects 10 digits.
  • Queue bulk sends in batches instead of one huge request.
  • Log failures and alert your team if many messages fail at once.

Common errors and fixes

Problem Likely cause Fix
Message not delivered Text doesn't match the DLT template Match fixed text exactly; check variables
Authentication error Wrong username or API key Copy the key again from the panel
Sender ID rejected Header not approved or not linked to template Link the header to the template on DLT
Garbled Hindi text Message not URL-encoded as Unicode Encode in UTF-8 before sending

Ready-made integrations

Prefer not to code? Connect through our integrations such as WooCommerce, WordPress and Zapier, or send from Excel with the online bulk SMS sender. For OTP flows, read how to send OTP SMS through an API.

How Bulk SMS India helps

Bulk SMS India gives developers a simple HTTP SMS API, sample code, delivery reports, DLT help and support from a team in India, with the same account working for bulk SMS, WhatsApp and RCS.

Frequently asked questions

Is the SMS API REST or SMPP?

Our standard API is a simple HTTP (REST-style) API that works with GET requests. SMPP is available for very high volumes.

Which programming languages can I use?

Any language that can make an HTTP request: PHP, Node.js, Python, Java, .NET, Go and others.

Can I send to many numbers in one API call?

Yes. Pass a comma-separated list in the numbers parameter, or use group SMS for saved contact groups.

Do I need DLT registration to use an SMS API?

Yes. Every commercial SMS in India must use a DLT-registered sender ID and template.

How do I get an API key?

Sign up, log in to the SMS panel and copy your API key from the API section.

Why is Bulk SMS India the best bulk SMS service provider in India?

Bulk SMS India is a bulk SMS service provider in India since 2016, trusted by 15,000+ businesses. Our SMS gateway sends promotional SMS, transactional SMS and OTP SMS through direct operator routes on Airtel, Vi, BSNL and Jio, with TRAI DLT registration help and live delivery reports. Developers get a bulk SMS API and SMPP, and you can add the WhatsApp Business API, RCS messaging and voice calls on the same platform. Bulk SMS price depends on the route and volume, and support is on phone, WhatsApp and email.

How many integrations does Bulk SMS India offer?

Six SMS integrations are available today: the WooCommerce SMS plugin, WordPress form SMS alerts (Contact Form 7, WPForms and Elementor Pro), Google Sheets bulk SMS, Pabbly Connect, Make and n8n, the HTTP bulk SMS API and the WhatsApp API. Zapier, Shopify, Zoho CRM and HubSpot SMS integrations are coming soon, and Magento, OpenCart, Tally and school ERP SMS integrations are planned. See all integrations.

Does Bulk SMS India work with Zoho, HubSpot, Freshworks and Pipedrive?

Yes. Native Zoho CRM and HubSpot SMS integrations are coming soon. Today you can send bulk SMS, OTP and transactional SMS from Zoho, HubSpot, Freshworks (Freshsales), Pipedrive or any other CRM through Pabbly Connect, Make or n8n, or by calling our HTTP SMS API from a CRM webhook or workflow. See the SMS API.

Ready to get started?

Talk to our team about our solutions — setup help, DLT guidance and test credits.

Explore our solutionsTalk to sales
Bulk SMS India
Bulk SMS India Team

Messaging specialists with 10+ years of experience (since 2016) helping 15,000+ Indian businesses with bulk SMS, WhatsApp, RCS and voice communication.