検証リクエストのキャンセル

ユーザーが正しいコードを入力した場合でも、Verify API にキャンセル要求を送信して検証プロセスを終了することができます。

必要に応じて、サンプルコードの以下の変数を独自の値に置き換えてください:

キー説明
JWT

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

REQUEST_ID

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

VONAGE_APPLICATION_PRIVATE_KEY_PATH

Private key path.

VONAGE_APPLICATION_ID

The Vonage Application ID.

Write the code

Add the following to cancel-request.sh:

curl -X DELETE "https://api.nexmo.com/v2/verify/$VERIFY_REQUEST_ID" \
  -H "Authorization: Bearer $JWT"\
  -H 'Content-Type: application/json'

View full source

Run your code

Save this file to your machine and run it:

sh cancel-request.sh