Cancel verification request
If the user decides to cancel the verification process, you should send a control request to the Verify API. This will terminate the verification process even if the user supplied the correct code.
Note: You can only cancel a verification request after 30 seconds, but before any second attempt is made.
Replace the following variables in the sample code with your own values:
| Key | Description |
|---|---|
VONAGE_API_KEY | Your Vonage API key (see it on your dashboard). |
VONAGE_API_SECRET | Your Vonage API secret (also available on your dashboard). |
REQUEST_ID | The ID of the Verify request (this is returned in the API response when you send a verification code) |
Run your code
Save this file to your machine and run it:
Prerequisites
Create a file named cancel.js and add the following code:
Run your code
Save this file to your machine and run it:
Prerequisites
Add the following to build.gradle:
Create a class named CancelVerification and add the following code to the main method:
Run your code
We can use the application plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.kt.verify.legacy with the package containing CancelVerification:
Prerequisites
Add the following to build.gradle:
Create a class named CancelVerification and add the following code to the main method:
Run your code
We can use the application plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.verify with the package containing CancelVerification:
Prerequisites
Create a file named CancelVerificationRequest.cs and add the following code:
Add the following to CancelVerificationRequest.cs:
Prerequisites
Create a file named cancel.php and add the following code:
Run your code
Save this file to your machine and run it:
Prerequisites
Run your code
Save this file to your machine and run it:
Prerequisites
Create a file named cancel.rb and add the following code:
Run your code
Save this file to your machine and run it: