WhatsApp & Messaging 8 min read

Fast2SMS API Tutorial: Send OTP, DLT and Quick SMS from Your Website or App

A beginner-friendly Fast2SMS guide: account setup, the difference between OTP, DLT and Quick SMS routes, sending messages from Node.js or PHP, checking delivery and keeping costs under control.

Umer Hasan

Umer Hasan

Co-Founder & CTO at Zapprex

Fast2SMS API Tutorial: Send OTP, DLT and Quick SMS from Your Website or App
Table of contents

What Fast2SMS is

Fast2SMS is an Indian bulk SMS service popular with small businesses and developers because it is quick to start and offers a simple HTTP API. You can send OTPs, transactional alerts with your DLT templates, and quick promotional or informational messages.

At a glance: Good practices — Generate OTPs on your server, Never trust the client, Throttle requests, Watch balance
At a glance: Good practices

Understand the routes

RouteUse it forNeeds your own DLT?
OTPSending numeric OTPs with a standard messageNo — uses the provider’s registered template
DLTYour own transactional or promotional templates and sender IDYes — Entity, header and template IDs
Quick SMSQuick messages without your own templatesNo — but usually costs more and has restrictions

Tip: For a branded experience and the best delivery, register your own DLT templates and use the DLT route for production traffic.

Send your first message

Send your first message: 5 steps
  1. 1

    Create an account: sign up, verify your mobile number and add wallet balance.

  2. 2

    Get your API key: from the Dev API section of the dashboard; keep it on your server.

  3. 3

    Add DLT details (for the DLT route): your sender ID and approved template IDs.

  4. 4

    Call the API: send a POST request with the route, numbers and message or template details.

  5. 5

    Check the response: store the request ID and check delivery reports in the dashboard.

Send an OTP via Fast2SMS (illustrative — confirm parameters in the current docs)javascript
const res = await fetch("https://www.fast2sms.com/dev/bulkV2", {
  method: "POST",
  headers: {
    authorization: process.env.FAST2SMS_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    route: "otp",
    variables_values: "482931",      // the OTP your server generated
    numbers: "9800000000",
  }),
})
console.log(await res.json())       // includes a request id on success

Good practices

  • Generate OTPs on your server: use a cryptographically secure random generator and store only a hash with an expiry.
  • Never trust the client: verify the OTP server-side and lock the account after several wrong attempts.
  • Throttle requests: limit OTP sends per number and per IP.
  • Watch balance: set alerts so OTPs never fail because the wallet is empty.
  • Compare providers: as volumes grow, compare price per SMS, delivery speed and support across providers.

Topics

Fast2SMSSMS APIOTP SMSBulk SMS India
Umer Hasan
Written by

Umer Hasan

Co-Founder & CTO at Zapprex

Leads engineering, cloud infrastructure and AI automation at Zapprex Technologies, with 7+ years of full-stack and mobile experience.

FAQ

Questions readers ask

Fast2SMS is a paid, prepaid service; you add wallet balance and pay per message depending on the route. Check the current pricing in your dashboard.

Have a project in mind?

Let's build something that moves your business forward.

Share your idea, process or problem — we will come back with a clear plan, timeline and cost range. No technical spec needed.

  • Founder reply within 1 business day
  • NDA on request · 100% code ownership
  • Talk directly to the engineers