As a developer, building SMS workflows is a standard task. Whether you are validating a user’s phone number during registration, setting up multi-factor authentication (MFA), or dispatching critical alerts, SMS integrations are core to modern applications.
However, testing these flows is often a headache:
- Carrier Billing Charges: Every text message sent to physical numbers costs money, causing test runs to rack up significant API bills.
- Rate Limits and Spam Blockers: Real carriers block repeated verification codes sent from the same IP or account to prevent spam, stalling QA testing.
- Regulatory Compliance (A2P 10DLC): Setting up production numbers requires business registration and vetting before you can even send a simple test string.
- Offline Development Barriers: When working locally or in a sandbox container, you often lack internet routing to hit standard API endpoints.
To bypass these hurdles, we created the OD2 SMS Mock API Gateway & Free Test Phone Numbers Sandbox, a 100% free, simulated sandbox designed to speed up your local development.
Mock SMS & OTP Verification Gateway
Test SMS notifications and 2FA OTP codes in real-time with zero carrier costs.
What is a Mock SMS API Gateway?
Unlike standard SMS providers (such as Twilio, Plivo, or Vonage) that transmit message payloads to physical cell towers and carrier networks, a mock SMS gateway is an offline-friendly sandbox.
It intercepts the outgoing API requests from your application’s SDK. Instead of sending the text message to a real phone, the gateway:
- Validates the authorization header (Basic or Bearer format).
- Parses the request parameters (recipient number, sender ID, and text body).
- Safely records the message log in a database.
- Streams the incoming message to a real-time web dashboard using Socket.io.
This lets developers monitor message deliveries, verify OTP codes, and check payload formatting without ever writing to actual networks or spending a single cent.
Key Features of the OD2 SMS Sandbox
- Free Virtual Test Phone Numbers: Instantly copy preset sandbox numbers representing different countries (US 🇺🇸, UK 🇬🇧, AU 🇦🇺, CA 🇨🇦, and IN 🇮🇳) to test international format parsing.
- Drop-in Twilio Compatibility: Supports standard Basic Authentication (using Account SID as username and Auth Token as password) and handles parameter aliases (like
To/Recipient,Body/Text/Message). - Real-Time Stream: Open the dashboard and watch test messages stream onto the screen with zero page reloads.
- Privacy & Auto-Expiration: To protect development security, all messages automatically expire and are permanently deleted after 1 hour. API credentials are encrypted using one-way cryptographic hashing.
- Desktop Push Alerts: Enable push notifications to get a browser popup when an automated test script triggers a new text message.
3 Steps to Integrate the Gateway in Your App
Connecting your local code to the mock SMS gateway takes less than three minutes.
1. Request Your Free Credentials
Visit the OD2 SMS Sandbox Dashboard and click the Request Free Integration / API Key button. This pre-fills a request on the Contact form. You will receive an Account SID (Username) and a custom Auth Token (Password).
2. Configure Your Client Endpoint
Modify your application’s environment configuration to point to our mock endpoint:
- Endpoint:
https://od2.in/api/sms/send - Authentication: HTTP Basic Auth (Username =
Account SID, Password =Auth Token)
3. Send a Test Payload
Run a quick cURL, Node.js, or Python script to trigger your first simulated message.
Integration Examples
cURL
bashcurl -X POST https://od2.in/api/sms/send \ -u "AC_YOUR_ACCOUNT_SID:sk_sms_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "from": "+1234567890", "to": "+18005550199", "body": "Your test verification code is 49201" }'
Node.js (Axios)
javascriptconst axios = require('axios');const auth = Buffer.from('AC_YOUR_ACCOUNT_SID:sk_sms_your_api_key').toString('base64');axios.post('https://od2.in/api/sms/send', { from: '+1234567890', to: '+18005550199', body: 'Your test verification code is 49201'}, { headers: { 'Authorization': `Basic ${auth}`, 'Content-Type': 'application/json' }}).then(res => console.log('Mock SID:', res.data.sid)).catch(err => console.error(err.response.data));
Python
pythonimport requestsfrom requests.auth import HTTPBasicAuthurl = "https://od2.in/api/sms/send"auth = HTTPBasicAuth("AC_YOUR_ACCOUNT_SID", "sk_sms_your_api_key")payload = { "from": "+1234567890", "to": "+18005550199", "body": "Your test verification code is 49201"}response = requests.post(url, json=payload, auth=auth)print(response.json())
Once executed, open the OD2 Sandbox Inbox, select +18005550199, and watch the verification code popup in real-time.
Transitioning to Production Gateways
Once you complete local testing and QA verification, you will need to replace the sandbox configurations with real carriers to transmit texts to actual customer phones. Depending on your scaling needs and budget, here are our recommended production SMS gateways:
- Plivo (Budget-Friendly): Offers highly competitive global routing rates for startups and high-volume developers on a budget.
- Twilio (Standard / Moderate): The market-standard API suite featuring top-tier developer SDKs, documentation support, and visual designer workflows.
- Vonage / Nexmo (Standard / Moderate): Excellent international coverage rates with reliable custom multi-factor authentication modules.
- Infobip (Enterprise / Premium): Highly optimized direct carrier routes suited for enterprise security requirements and high-priority delivery guarantees.
Start Testing Today
Stop paying carrier fees for draft verification codes. Accelerate your development cycle by setting up the Free OD2 SMS Sandbox today. Check out our adjacent developer utilities like Temp Mail and the HTML Email Tester to streamline all your communication flows.
