💬 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
OTP

Test Your OTP API: Postman, Free Test Credits and Delivery Reports

SMSGatewayHub 7 views
Quick answer

The quickest way to test an OTP API in Postman is to create a GET request to https://www.smsgatewayhub.com/api/mt/SendSMS, add the parameters in the Params tab (channel=OTP, your sender ID, DLT entity ID and template ID), keep the API key in a Postman environment variable, and add a test that checks ErrorCode is "000". SMSGatewayHub does not run a separate sandbox: you test on the live API with the 1,000 free SMS credits you get on sign-up, sending to your own numbers, and you watch the result in the panel's live delivery reports.

Key takeaways

  • Postman setup takes five minutes: one GET request, eleven parameters, one environment variable for the key.
  • No sandbox, real delivery: free credits on sign-up let you test real OTP delivery to your own phones before you pay.
  • Track every send: store the JobId and MessageId from the response and check them in the panel's delivery reports.
  • Webhooks for your own app: fire signed otp.sent, otp.verified and otp.failed events from your backend to the systems that need them.

How do you build the Send OTP request in Postman?

  1. Create an environment called "SMSGatewayHub" with the variables apiKey, senderId, entityId, templateId and testNumber. Mark apiKey as a secret so it is hidden on screen.
  2. Create a new request, choose GET and enter https://www.smsgatewayhub.com/api/mt/SendSMS.
  3. Open the Params tab and add the parameters from the table below. Postman builds and encodes the query string for you.
  4. Select the environment in the top-right corner and click Send.
  5. Read the JSON response in the lower panel and check your phone.
KeyValue in PostmanMeaning
APIKey{{apiKey}}Your API key from the panel
senderid{{senderId}}Your DLT-registered transactional header
channelOTPSends on the OTP route
DCS0Normal English text
flashsms0Normal SMS, not flash
number{{testNumber}}Your own mobile, for example 9198XXXXXXXX
text482913 is your OTP to log in to ABC App. Do not share it. - ABCMust match your approved template
route1Route value from the API docs
EntityId{{entityId}}Your DLT principal entity ID
dlttemplateid{{templateId}}Your approved OTP template ID

The full parameter list and other endpoints are in the developer API docs.

What should a successful response look like?

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

ErrorCode "000" means the request was accepted. Any other code comes with an ErrorMessage that tells you what to fix, such as a wrong key or a missing parameter. "Accepted" is not the same as "delivered": the operator still checks the text against your DLT template, so always confirm on the phone and in the delivery report.

How do you add automatic checks in Postman?

Paste this into the request's Tests tab (called Scripts, Post-response, in newer Postman versions). It fails the run if the API did not accept the OTP and saves the JobId for later.

pm.test("HTTP 200", function () {
    pm.response.to.have.status(200);
});

const body = pm.response.json();

pm.test("OTP accepted (ErrorCode 000)", function () {
    pm.expect(body.ErrorCode).to.eql("000");
});

pm.test("JobId returned", function () {
    pm.expect(body.JobId).to.be.a("string").and.not.empty;
});

pm.environment.set("lastJobId", body.JobId);
✔
Save the request in a collection and run it with the Collection Runner or Newman in your CI pipeline before each release. Keep the number of test sends small, because every test is a real SMS.

Is there an OTP API sandbox?

SMSGatewayHub does not run a separate sandbox server. Every test goes through the live API, which has one big advantage: you see real delivery speed, real DLT checks and real operator behaviour before launch, not a simulation. To test safely and at no cost:

  • Use the free credits. New accounts get 1,000 free SMS credits with no credit card. That is plenty for development and QA.
  • Send only to your own and your team's numbers. Keep a short list of test phones on different operators (Jio, Airtel, Vi, BSNL) to check every network.
  • Register a test OTP template on DLT that you can also use in production, so the text you test is the text you ship. Our team helps with DLT registration free of cost.
  • Mock the API in unit tests. Your automated tests should replace the HTTP call with a stub that returns the JSON above, so they never send real SMS.

How do you check OTP delivery reports?

Store the JobId and each MessageId with the login attempt in your database. Then:

  • In the panel: open the live delivery reports to see the operator status for every OTP, such as delivered or failed, with the error reason.
  • From your code: use the delivery report options described in the developer API docs to pull the status for a JobId.
  • Pushed to your server: if you need delivery reports sent to your own URL, ask support which callback options your account has.
ℹ️
You pay only for delivered OTPs. Typical delivery is 2-6 seconds, and the platform retries automatically with load balancing across operator routes, so a single route problem rarely stops a code.

How do you build your own OTP webhook?

Many teams want other systems, such as a CRM, a fraud tool or an analytics pipeline, to know when an OTP was sent, verified or failed. The clean way is to fire webhooks from your own backend, because that is where the OTP flow lives. Three events cover most needs:

EventWhen your backend fires itUseful fields
otp.sentSendSMS returned ErrorCode 000phone (masked), jobId, messageId, time
otp.verifiedThe user entered the right code in timephone (masked), jobId, seconds to verify
otp.failedToo many wrong tries, expiry or a send errorphone (masked), reason, attempts

Sign every webhook with HMAC-SHA256 so the receiver can prove it came from you. A Node.js example:

const crypto = require('crypto');

async function fireWebhook(url, secret, event, data) {
  const body = JSON.stringify({ event, data, ts: Math.floor(Date.now() / 1000) });
  const sig = crypto.createHmac('sha256', secret).update(body).digest('hex');
  await fetch(url, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json', 'X-Signature': sig },
    body
  });
}

// after SendSMS returns ErrorCode "000"
await fireWebhook(process.env.HOOK_URL, process.env.HOOK_SECRET, 'otp.sent',
  { phone: '9198XXXX' + 'XXXX', jobId: data.JobId });

On the receiving side, recompute the HMAC over the raw body and compare it with crypto.timingSafeEqual, reject events with an old ts, and never put the OTP itself in a webhook.

What should you check before going live?

  • DLT ready: entity, transactional header and OTP template approved; the production text matches the template exactly.
  • Key safe: the API key lives in server configuration or a secrets manager, never in an app or front-end code.
  • Codes secure: random 6 digits, stored hashed, 5-minute expiry, one use, 5 attempts. See our verify and resend OTP guide.
  • Abuse limits: resend cooldown of 30 to 60 seconds, daily cap per number, rate limits per IP.
  • Monitoring: log every JobId, alert when the share of non-000 responses or failed deliveries rises.
  • Fallback: offer WhatsApp, voice or missed-call verification, or OneTap Verify links, for users whose SMS keeps failing.
  • Credit topped up: pick an OTP pack from OTP SMS pricing: ₹0.185 to ₹0.245 per SMS + 18% GST, DLT scrubbing included.
Test real OTP delivery today with 1,000 free SMS credits
No credit card. Get your API key, paste it into Postman and send your first OTP in minutes.
Create free account

Frequently asked questions

How do I test the OTP API in Postman?

Create a GET request to https://www.smsgatewayhub.com/api/mt/SendSMS, add APIKey, senderid, channel=OTP, DCS, flashsms, number, text, route, EntityId and dlttemplateid in the Params tab, and send it. A JSON response with ErrorCode 000 means the OTP was accepted.

Does SMSGatewayHub have an OTP sandbox?

No separate sandbox. You test on the live API using the 1,000 free SMS credits given on sign-up, sending to your own numbers, so you see real delivery and real DLT checks before launch.

How do I know if a test OTP was delivered?

Save the JobId and MessageId from the response and check them in the panel's live delivery reports, or use the delivery report options in the developer API docs.

Can I get delivery reports on a webhook?

Ask support which callback options your account has. For your own systems, the reliable pattern is to fire signed otp.sent, otp.verified and otp.failed webhooks from your backend.

Do test messages cost money?

Test messages are real SMS and use credits, but new accounts get 1,000 free credits. After that, OTP SMS costs ₹0.185 to ₹0.245 per SMS plus 18% GST, and you pay only for delivered OTPs.

Related reading: OTP SMS API, OTP REST API reference, OTP SMS API in PHP and Laravel, OTP login with Node.js and React, and OTP login for Flutter and iOS.

Sources: SMSGatewayHub OTP SMS API documentation, published OTP pricing and sign-up offer (November 2026); Postman documentation for environments and test scripts; TRAI DLT rules for commercial SMS. Prices exclude 18% GST and can change; confirm your rate with sales.