Send verification request using multiple channels for fallback

You can start the verification process by sending a verify request to the Verify API. The following example will send a verification request that uses this workflow:

Where needed, replace the following variables in the sample code with your own values:

KeyDescription
JWT

Used to authenticate your request. See Authentication for more information, including how to generate a JWT.

BRAND_NAME

Included in the message to explain who is confirming the phone number

VONAGE_APPLICATION_PRIVATE_KEY_PATH

Private key path.

VONAGE_APPLICATION_ID

The Vonage Application ID.

TO_NUMBER

The phone number to verify

TO_EMAIL

The email address to send the verification request to.

Write the code

Add the following to request.sh:

curl -X POST \
  --url https://api.nexmo.com/v2/verify \
  -H "Authorization: Bearer $JWT"\
  -H 'Content-Type: application/json' \
  -d $'{
	 "brand": "'$BRAND_NAME'",
   "workflow": [
      {
         "channel": "silent_auth",
         "to": "'$TO_NUMBER'"
      },
			{
         "channel": "email",
         "to": "'$EMAIL_TO'"
      }
   ]
}'

View full source

Run your code

Save this file to your machine and run it:

sh request.sh

Note: If you receive a callback to your designated webhook indicating the request was blocked, the target network might have been blocked by the platform's anti-fraud system.