SMS verification API for testing OTP codes

· 5 min read · QuickInbox team

  • SMS
  • OTP
  • API

Most "SMS verification APIs" send codes. To test your app you need the other half: a number that receives the code and gives it back to your test as data.

Sending API vs testing API

Your app already uses a provider like Twilio, Vonage or AWS SNS to send codes. A testing API sits on the receiving side. It gives your tests a real phone number and lets them read what arrives, so you can check the whole chain: your code asked for a text, the provider delivered it, and the code inside works.

How it works with QuickInbox

  1. Claim a number. Every paid plan includes a real US number. Claim it on the SMS page in your workspace.
  2. Use it in your app. Your test types the number into the phone field and triggers the code.
  3. Read the text. GET /api/business/sms/numbers/:id/messages returns the texts as JSON, newest first, each with from_number, body and received_at.
  4. Finish the flow. Pull the code out of the body and type it in.

The API in one example

curl "https://business.quickinbox.net/api/business/sms/numbers" \
  -H "X-API-Key: $QI_KEY"
# => { "numbers": [ { "id": 3, "phone_number": "+1...", ... } ], ... }

curl "https://business.quickinbox.net/api/business/sms/numbers/3/messages" \
  -H "X-API-Key: $QI_KEY"
# => { "messages": [ { "from_number": "+1...", "body": "Your code is 482913", ... } ] }

The number's id comes from the first call; it's not the phone number itself. Full reference: Business API docs.

Framework guides

Email codes too

The same account and API key give you private test inboxes, so one test suite can cover both email and SMS codes. See email OTP testing.

Related guides

Get a test number: every paid QuickInbox plan includes a real US phone number and a monthly SMS allowance, with plans from $9 a month. Extra packs start at $5 a month. See SMS testing and pricing.

← All articles