Verifyリクエストの検索
検索機能を使って、Verifyリクエストの現在のステータスや最終的な結果を見ることができます。 request_id Verifyコードが送信されたときに返される。
サンプルコードの以下の変数を、独自の値に置き換えてください:
| キー | 説明 |
|---|---|
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
Add the following to build.gradle:
Create a class named SearchVerification and add the following code to the main method:
Run your code
We can use the アプリケーション 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 SearchVerification:
Prerequisites
Add the following to build.gradle:
Create a class named SearchVerification and add the following code to the main method:
VonageClient client = VonageClient.builder()
.apiKey(VONAGE_API_KEY)
.apiSecret(VONAGE_API_SECRET)
.build();Write the code
Add the following to the main method of the SearchVerification class:
SearchVerifyResponse response = client.getVerifyClient().search(VERIFY_REQUEST_ID);
if (response.getStatus() == VerifyStatus.OK) {
response.getVerificationRequests().forEach(it -> {
System.out.println(it.getRequestId() + " " + it.getStatus());
});
}Run your code
We can use the アプリケーション 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 SearchVerification:
Prerequisites
Create a file named SearchVerificationRequest.cs and add the following code:
Add the following to SearchVerificationRequest.cs:
Prerequisites
Create a file named search.php and add the following code:
$basic = new \Vonage\Client\Credentials\Basic(VONAGE_API_KEY, VONAGE_API_SECRET);
$client = new \Vonage\Client(new \Vonage\Client\Credentials\Container($basic));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 search.rb and add the following code:
Run your code
Save this file to your machine and run it: