Check a verification code

Check the verification code that a user has provided. You should always check the verification code after sending it. This enables Vonage to determine the number of successful requests and protect against fraudulent use of the platform.

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

KeyDescription
REQUEST_ID

The ID of the Verify request (this is returned in the API response when you send a verification code)

JWT

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

VONAGE_APPLICATION_PRIVATE_KEY_PATH

Private key path.

VONAGE_APPLICATION_ID

The Vonage Application ID.

CODE

The code the user supplies as having been sent to them

Write the code

Add the following to check-verification-code.sh:

View full source

Run your code

Save this file to your machine and run it:

sh check-verification-code.sh