Playground API
DocsStatsBlogStudio
Documentation Tree
Technical BlogFeature Deep Dives
  • Introduction
  • Quickstart
    5 min
  • How It Works
  • Recipes & Cookbooks
  • Platform Comparisons
  • Real-World Showcase
  • Interactive Studio
    Studio
  • GraphiQL IDE
    IDE
  • Session Quotas & Activity
  • Network Chaos Simulator
  • Atomic Sandbox Reset
  • Overview & Models
    Hub
  • Users Resource
  • Posts Resource
  • Comments Resource
  • Todos Resource
  • Custom Collections
    Custom
  • Multipart File Uploads
    Upload
  • Dynamic SVG Avatars
    SVG
  • Image Thumbnails
    CDN
  • Relational Filtering
  • Full-Text Search
  • Dynamic Sorting
  • Offset Pagination
  • Cursor Pagination
    Scroll
  • CSV & Excel Export & Import
    IO
  • Custom Collections
    CRUD
  • Overview & Architecture
    Hub
  • JWT Auth Flow
  • Refresh Token Rotation
    Mutex
  • RBAC Permission Matrix
    Roles
  • Expiry Simulation
  • Clock Skew Drift
  • Password Recovery Loop
  • Dual-Mode Sandboxing
  • GraphiQL IDE
    IDE
  • Relational Queries
  • Stateful Mutations
  • Realtime Subscriptions
  • Overview & Flowcharts
    Hub
  • Hosted Checkout
    Stripe
  • Payment Intents API
  • 3DS Challenge Modal
    Modal
  • Customers Vault
  • Charges & Refunds
  • Test Cards Catalog
  • Overview & Channels
    Hub
  • Virtual Email Mailbox
    Mailtrap
  • Virtual SMS Terminal
    Phone
  • In-App Notifications
  • Message Dispatcher
  • Realtime Studio
    Studio
  • Native WebSocket (/ws)
  • Socket.io Gateway
  • Presence & Echo Bot
  • Server-Sent Events (SSE)
    SSE
  • Analytics Telemetry
  • Webhook Subscriptions
  • HMAC SHA-256 Signatures
  • Delivery Logs
  • Manual Retry Simulator
  • Network Latency Delay
  • HTTP Status Codes
  • Rate-Limit Simulator
    429
  • Flaky Network & Jitter
    Chaos
  • Session Quotas & Activity
  • JSON Snapshots
    JSON
  • Headless CI/CD Testing
    CI
  • Mobile QR Code Sync
  • System Metrics & Health
  • Atomic Sandbox Reset
  • Official TypeScript SDK
  • Multi-Language Generators
  • DevTools Extension
  • OpenAPI 3.1 Spec
    JSON
  • Postman Collection v2.1
  • Bruno Collection
  • Insomnia Workspace
  • TypeScript .d.ts
    .d.ts
  • AI Prompt Rules
    Rules
  • Context Index (llms.txt)
  • Full Schema (llms-full.txt)
  • Manifest (product.json)
  • All Feature Articles
    Blog
  • React CRUD Without Backend
    Deep Dive
  • Why Static APIs Fail
  • Mocking Stateful Auth
  • WebSockets & SSE Guide
Technical Blog
Articles

In-depth articles explaining stateful mock APIs, WebSockets, payments, and frontend resilience.

Read Articles
PreviousVirtual Email Mailbox
NextIn-App Notifications
Virtual Communications

Virtual SMS Terminal & 2FA Simulator

Test mobile phone number verifications, SMS-based two-factor authentication (2FA), and critical security alerts. Automatically detects 4-digit and 6-digit numeric passcodes without carrier contracts or Twilio API keys.

Interactive Mobile TerminalAPI ConsolesTwilio Integration Recipes
9:41
SMS
MessagesVisitor Sandbox Phone

No incoming SMS recorded.

Send an SMS via the API console below.

Virtual SMS Capabilities

Real telecom SMS gateways (Twilio, MessageBird, AWS SNS) charge per delivery, require regulatory A2P 10DLC registration, and take several seconds to hit physical handsets. Playground API intercepts SMS requests locally in memory with sub-millisecond latencies.

Auto OTP Code Extractor

Detects 4-digit or 6-digit codes automatically and attaches them to the otp_code JSON attribute.

Real-Time Broadcast

Emits SSE events (sms.received) and WebSocket broadcasts whenever a message arrives.

Supported Outbound Payload

POST /api/v1/sms/send { "to": "+1 (555) 012-3456", "from": "+1 (555) 019-9000", "message": "Your verification code is 491028" }

Interactive SMS Consoles

Dispatch SMS messages and query active device logs.

1. Send SMS Message

Dispatch Virtual SMS

POST
response.json
1
{
2
// Click "Send" above to execute this request against the live server.
3
}

2. Query SMS History

List Received SMS Messages

GET
response.json
1
{
2
// Click "Send" above to execute this request against the live server.
3
}

Twilio-Compatible SDK Integration

Swap your production Twilio URL to Playground API in your local and staging environments.

Node.js Fetch / Axios Wrapper

javascript
1
import axios from 'axios';
2
3
export async function sendVerificationSms(phoneNumber, otpCode) {
4
const isDev = process.env.NODE_ENV !== 'production';
5
const apiUrl = isDev
6
? 'https://playground.nileslabs.com/api/v1/sms/send'
7
: 'https://api.twilio.com/2010-04-01/Accounts/.../Messages.json';
8
9
const response = await axios.post(apiUrl, {
10
to: phoneNumber,
11
from: '+15550199000',
12
message: Your security verification code is: ${otpCode},
13
});
14
15
return response.data;
16
}

Python Requests Wrapper

python
1
import requests
2
3
def send_sms_alert(phone_number: str, text: str):
4
res = requests.post(
5
"https://playground.nileslabs.com/api/v1/sms/send",
6
json={
7
"to": phone_number,
8
"message": text
9
}
10
)
11
return res.json()