Check verification code

Check a verification code that a user has provided. Use the request_id that was received when the verification code was sent with the check.

curl "https://api.nexmo.com/verify/check/json?api_key=API_KEY&api_secret=API_SECRET&request_id=4952dfad368448fb9dd8e3591c7c5f52&code=1234"
var Nexmo = require('nexmo');

var nexmo = new Nexmo({
    apiKey: API_KEY,
    apiSecret: API_SECRET,
  });

nexmo.verify.check({request_id: UNIQUE_ID_FROM_VERIFICATION_REQUEST, code: '1234'}, callback);
import com.nexmo.client.NexmoClient;
import com.nexmo.client.auth.AuthMethod;
import com.nexmo.client.verify.CheckResult;

AuthMethod auth = new TokenAuthMethod(API_KEY, API_SECRET);
NexmoClient client = new NexmoClient(auth);

CheckResult result = client.check(REQUEST_ID, CODE);
<?php
$client = new Nexmo\Client(new Nexmo\Client\Credentials\Basic(API_KEY, API_SECRET));
$client->verify()->check($verification, '1234');
import nexmo
client = nexmo.Client(key=API_KEY, secret=API_SECRET)

response = client.check_verification(REQUEST_ID, code='1234')
if response['status'] == '0':
    print 'User verification complete!'
require 'nexmo'

client = Nexmo::Client.new(api_key: API_KEY, api_secret: API_SECRET)

response = client.verify.check(request_id: REQUEST_ID, code: '1234')

puts "User verification complete!" if response.status == '0'

Guides

Building Blocks

Reference