Node.js

Testing the Backend

Start the server:

node server.js

Open a new terminal and use cURL to send a request to the /verification endpoint. The request must include the phone number in the body:

curl -X POST http://localhost:4000/verification \
  -H "Content-Type: application/json" \
  -d '{"phone":"+34600000000"}'

The request should return a 200 Ok response containing the request_id and the check_url. At this point we could use cURL again to send the check_url:

curl -L https://api-eu-4.vonage.com/v2/verify/aaa-bbb-cccc-dddd/silent-auth/redirect

The backend is now ready to be called from the mobile app. Next, we’ll build the Android client to complete the full 2FA flow.