ReOTP.
API Reference/2. Check Status
1 min read

2. Check Status

Query the status of the ongoing verification session.

Once the verification process is initialized and you get a requestId, your frontend needs to listen (via SSE) to the stream endpoint to know if the user has sent the message.

Plan A: SSE Mechanism (Fastest):

  • Open an EventSource connection to the stream endpoint.
  • Once you receive the "VERIFIED" status, close the connection and log the user in.

Fallbacks (Plan B & C):

  • Plan B (Polling): If your hosting environment does not support SSE, you can fall back to traditional polling by making a GET request to /api/verify/status?id=... every 3 seconds.
  • Plan C (Webhooks): For robust server-to-server synchronization, utilize our Webhook system. See the Webhooks section for details.

Returned Session Statuses:

  • PENDING: The user has not sent the verification message yet. Keep listening.
  • VERIFIED: The message was received, and the number is verified.
  • EXPIRED: The session has timed out (usually 2 minutes after initiation).
Integration Code (SDKs)
curl -N https://reotp.com/api/verify/stream?id=YOUR_REQUEST_ID

Interactive Live API Playground

Test verification requests live and generate integration code in your preferred programming language.

curl -X POST https://reotp.com/api/verify/init \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumber": "201000000000",
    "method": "WHATSAPP"
  }'