Send verification code

Send a verification code to a user phone to start a one time password, two-factor authentication or phone verification process.

curl "https://api.nexmo.com/verify/json?api_key=API_KEY&api_secret=API_SECRET&number=447700900000&brand=MyApp"
var nexmo = new Nexmo({apiKey: NEXMO_API_KEY, apiSecret: NEXMO_API_SECRET});

var verifyRequestId = null; // use in the check process

nexmo.verify.request({number: NEXMO_TO_NUMBER, brand: BRAND_NAME}, function(err, result) {
  if(err) { console.error(err); }
  else {
    verifyRequestId = result.request_id;
    console.log('request_id', verifyRequestId);
  }
});
import com.nexmo.client.NexmoClient;
import com.nexmo.client.auth.AuthMethod;
import com.nexmo.client.verify.VerifyResult;

AuthMethod auth = new TokenAuthMethod(API_KEY, API_SECRET);
NexmoClient client = new NexmoClient(auth);
VerifyResult request = client.getVerifyClient().verify(TO_NUMBER, "MyApp");
<?php
$client = new Nexmo\Client(new Nexmo\Client\Credentials\Basic(API_KEY, API_SECRET));
$verification = $client->verify()->start([
    'number' => '447700900000',
    'brand'  => 'My App'
]);
import nexmo

client = nexmo.Client(key=api_key, secret=api_secret)
verify_resp = client.start_verification(number='447700900000', brand='MyApp')
require 'nexmo'

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

client.verify.request(number: '447700900000', brand: 'MyApp')

Next

Guides

Building Blocks

Reference