Verify Now API Documentation

Version – 1.0

Introduction

Mobile phone number serves as the ultimate user identity in digital universe. Digital applications whether on web or on mobile verify mobile numbers of their users to ensure their authenticity. To address this growing need, Message Central has developed a reliable, quick and cost-effective mobile number verification service called Verify Now.

Help and Support

For implementation support and any feedback, please reach out to us at: operations@messagecentral.com

API Request and Response

The API will only accept requests from the service provider via the API Endpoint URI shared with the service provider and from whitelisted IP addresses over HTTP, partner to provide a list of source IP.

REST API Base URL’s:
All Platform API endpoints below should be prefixed with the following URL:
https://cpaas.messagecentral.com

Generate Token

To generate Auth token for Send OTP & Validate OTP header, please sign up on the platform.

A. Send OTP

To send otp on mobile number below are request parameters.

Request Header
Type
Mandatory?
authToken
String
yes
Field
Type
Mandatory?
Description
customerId
String
yes
Customer identifier
countryCode
String
yes
Country code
otpLength
Integer
no
Send a number between 4 and 8. Default is 4
mobileNumber
String
yes
Mobile number
flowType
String
yes
We send otp using multiple medium like sms,email etc. for now use SMS only
email
String
no
Email is used when we send otp through mail
langID
String
no
For sending sms in different languages . by default language is English. For now we support English only

Request URL Path:

/verification/v2/verification/send

Response JSON:
A successful response will return a 200 status code.

{
"responseCode": Integer,
"message": "String",
"data": {    
"verificationId": "String",
"mobileNumber": "String",
"responseCode": "String",
"errorMessage": "String",
"timeout": "String",
"smsCLI": "String",
"transactionId": "String"
}
}
Below is an example success send otp using the following multiple languages:
1
curl --location--request POST'https://cpaas.messagecentral.com/verification/v2/verification/send?countryCode=XX&customerId=****************&flowType=SMS&mobileNumber=971X8X2X23&otpLength=4'\--header 'authToken: eyJhbGciOiJIUzUxMiJ9.eyJzdLIiOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTY5NjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrPAFpxEanH64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA'
{  
    “responseCode”:200,  
     “message”: “SUCCESS”,  
     “data”:{      
            “verificationId”: “20”,    
           “mobileNumber”: “8846735392”,      
           “responseCode”: “200”,      
          “errorMessage”: null,      
          “timeout”: “60”,      
          “smsCLI”: null,      
        “transactionId”: null    
}
}
1
OkHttpClient client = new OkHttpClient()
.newBuilder().
build();

MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://cpaas.messagecentral.com/verification/v2/verification/send?countryCode=91&customerId=CC0157BFAF1B94F0&flowType=SMS&mobileNumber=9990655875")
.method("POST", body)
.addHeader("authToken", "eyJhbGciOiJIUzUxMiJ9.eyJzdLIiOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTY5NjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrPAFpxEanH64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA")
.build();
{  
    “responseCode”:200,  
     “message”: “SUCCESS”,  
     “data”:{      
            “verificationId”: “20”,    
           “mobileNumber”: “8846735392”,      
           “responseCode”: “200”,      
          “errorMessage”: null,      
          “timeout”: “60”,      
          “smsCLI”: null,      
        “transactionId”: null    
}
}
1
var request = require('request');
var options = {
'method': 'POST',
'url':'https://cpaas.messagecentral.com/verification/v2/verification/send?countryCode=91&customerId=C-C0157BFAF1B94F0&flowType=SMS&mobileNumber=9990655875',
'headers': {
'authToken': 'eyJhbGciOiJIUzUxMiJ9.eyJzdLIiOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTY5NjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrPAFpxEanH64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{  
    “responseCode”:200,  
     “message”: “SUCCESS”,  
     “data”:{      
            “verificationId”: “20”,    
           “mobileNumber”: “8846735392”,      
           “responseCode”: “200”,      
          “errorMessage”: null,      
          “timeout”: “60”,      
          “smsCLI”: null,      
        “transactionId”: null    
}
}
1
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request-
>setUrl('https://cpaas.messagecentral.com/verification/v2/verification/sendcountryCode=91&customerId=CC0157BFAF1B94F0&flowType=SMS&mobileNumber=9990655875');$request->setMethod(HTTP_Request2::METHOD_POST);$request->setConfig(array('follow_redirects' => TRUE));
$request->setHeader(array(
'authToken' => 'eyJhbGciOiJIUzUxMiJ9.eyJzdLIiOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTY5NjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrPAFpxEanH64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
{  
    “responseCode”:200,  
     “message”: “SUCCESS”,  
     “data”:{      
            “verificationId”: “20”,    
           “mobileNumber”: “8846735392”,      
           “responseCode”: “200”,      
          “errorMessage”: null,      
          “timeout”: “60”,      
          “smsCLI”: null,      
        “transactionId”: null    
}
}
1
import requests
url = "https://cpaas.messagecentral.com/verification/v2/verification/send?countryCode=XX&customerId=CXC0157XXXF1B94F0&flowType=SMS&mobileNumber=999XXXX875"

payload = {}
headers = {
'authToken': 'eyJhbGciOiJIUzUxMiJ9.eyJzdLIiOiJDLTMzNDMyQTVGwNCIsImlhdCI6MTY5NjMxNDQiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGRFrPAFpx64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA'}

response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
{  
    “responseCode”:200,  
     “message”: “SUCCESS”,  
     “data”:{      
            “verificationId”: “20”,    
           “mobileNumber”: “8846735392”,      
           “responseCode”: “200”,      
          “errorMessage”: null,      
          “timeout”: “60”,      
          “smsCLI”: null,      
        “transactionId”: null    
}
}
1
require "uri"
require "net/http"
url = URI("https://cpaas.messagecentral.com/verification/v2/verification/send?countryCode=XX&customerId=CXC0157XFXX1B94F0&flowType=SMS&mobileNumber=9990XXXX75")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)

request["authToken"] = "eyJhbGciOiJIUzUxMiJ9.eyJzdLIiOiJDLTMyQTVGNDlGNzQwNCIsImlMTY5NjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGmpxEanH64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA"

response = http.request(request)
puts response.read_body
{  
    “responseCode”:200,  
     “message”: “SUCCESS”,  
     “data”:{      
            “verificationId”: “20”,    
           “mobileNumber”: “8846735392”,      
           “responseCode”: “200”,      
          “errorMessage”: null,      
          “timeout”: “60”,      
          “smsCLI”: null,      
        “transactionId”: null    
}
}
1
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://cpaas.messagecentral.com/verification/v2/verification/send?countryCode=XX&customerId=CXC01XXXXAF1B94F0&flowType=SMS&mobileNumber=9990XXXX75");

request.Headers.Add("authToken", "eyJhbGcIUzUxMiJ9.eyJzdLIiOiJDLTMzNDMyQTVGNDlGNzQlhdCI6MTY5NjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SR64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();

Console.WriteLine(await response.Content.ReadAsStringAsync());
{  
    “responseCode”:200,  
     “message”: “SUCCESS”,  
     “data”:{      
            “verificationId”: “20”,    
           “mobileNumber”: “8846735392”,      
           “responseCode”: “200”,      
          “errorMessage”: null,      
          “timeout”: “60”,      
          “smsCLI”: null,      
        “transactionId”: null    
}
}

B. Validate OTP

To validate below are fields.
Field
Type
Mandatory?
Description
customerId
String
yes
Customer identifier
code
String
yes
Otp
verificationID
Long
yes
VerificationId from response of send Otp api
langID
String
no
For multiple language support by default is English.For now we support English only

Request URL Path:

/verification/v2/verification/validateOtp

Response JSON:
A successful response will return a 200 status code.

{
"responseCode": Integer,
"message": "String",
"data": {    
"verificationId": "String",
"mobileNumber": "String",
"responseCode": "String",
"errorMessage": "String",
"timeout": "String",
"smsCLI": "String",
"transactionId": "String"
}
}
Below is an example success validate otp using the following multiple languages:
1
curl --location'https://cpaas.messagecentral.com/verification/v2/verification/validateOtp?countryCode=XX&mobileNumber=971X8X2X23&verificationId=XX&customerId=************&code=XXXX'\--header 'authToken: eyJhbGciOiJIUzUxMiJ9.eyJzdLIiODMyQTVGNDlGNzQwNCIsImlhdCIMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGmpxEanH64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA'
{  
     "responseCode": 200,  
    "message": "SUCCESS",  
     "data": {    
            "verificationId":   "20",      
            "mobileNumber":   "8846735392",      
             "verificationStatus":   "VERIFICATION_COMPLETED",      
             "responseCode":  "200",      
             "errorMessage":   null,      
             "transactionId":   null,      
             "authToken": eyJhbGciOiJIUzUxMiJ9.eyJzdLIiDMyQTVGNDlGNzQwNCIsImlhNjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrP64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA
}
}
1
OkHttpClient client = new OkHttpClient()
.newBuilder()
.build();

MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://cpaas.messagecentral.com/verification/v2/verification/send?countryCode=XX&customerId=CXC0157XXAF1B94F0&flowType=SMS&mobileNumber=999XXXX875")

.method("POST", body)
.addHeader("authToken", "eyJhbGciOiJIUzUxMiJ9.eyJzdLIiODMyQTVGNDlGNzQwNCIsImlhdCIMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGmpxEanH64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA")
.build();

Response response = client.newCall(request).execute();
{  
     "responseCode": 200,  
    "message": "SUCCESS",  
     "data": {    
            "verificationId":   "20",      
            "mobileNumber":   "8846735392",      
             "verificationStatus":   "VERIFICATION_COMPLETED",      
             "responseCode":  "200",      
             "errorMessage":   null,      
             "transactionId":   null,      
             "authToken": eyJhbGciOiJIUzUxMiJ9.eyJzdLIiDMyQTVGNDlGNzQwNCIsImlhNjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrP64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA
}
}
1
var request = require('request');
var options = {'method': 'GET',
'url':
'https://cpaas.messagecentral.com/verification/v2/verification/validateOtp?countryCode=91&mobileNumber=999XXXX875&verificationId=XX&customerId=CXC01XXXFAF1B94F0&code=XXXX',
'headers': {
'authToken': 'eyJhbGciOiJIUzUxMiJ9.eyJzdLIiOiGNDlGNzQwNCIsImlhdCI6MTY5NjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrPAFpxEanH64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
{  
     "responseCode": 200,  
    "message": "SUCCESS",  
     "data": {    
            "verificationId":   "20",      
            "mobileNumber":   "8846735392",      
             "verificationStatus":   "VERIFICATION_COMPLETED",      
             "responseCode":  "200",      
             "errorMessage":   null,      
             "transactionId":   null,      
             "authToken": eyJhbGciOiJIUzUxMiJ9.eyJzdLIiDMyQTVGNDlGNzQwNCIsImlhNjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrP64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA
}
}
1
<?php

require_once 'HTTP/Request2.php';

$request = new HTTP_Request2();

$request-
>setUrl('https://cpaas.messagecentral.com/verification/v2/verification/validateOtp?countryCode=XX&mobileNumber=999XXXX875&verificationId=XX&customerId=C-C0XXXXF1B94F0&code=XXXX');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'authToken' => 'eyJhbGciOiJIUzUxMiJ9.eyJzdLVGNDlGNzQwNCIsImlhdCI6MTY5NjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrPAFpxEanH64ADANR6pgmGEoo-T4AXXmNYh6mFvLQzI__uaA'
));
try {
$response = $request->send();
if ($response->getStatus() == 200)
{
echo $response->getBody();
}
else
{
echo 'Unexpected HTTP status: ' .$response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e)
{
echo 'Error: ' . $e->getMessage();
}
{  
     "responseCode": 200,  
    "message": "SUCCESS",  
     "data": {    
            "verificationId":   "20",      
            "mobileNumber":   "8846735392",      
             "verificationStatus":   "VERIFICATION_COMPLETED",      
             "responseCode":  "200",      
             "errorMessage":   null,      
             "transactionId":   null,      
             "authToken":  eyJhbGciOiJIUzUxMiJ9.eyJzdLIiDMyQTVGNDlGNzQwNCIsImlhNjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrP64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA
}
}
1
import requests
url =
"https://cpaas.messagecentral.com/verification/v2/verification/validateOtp?countryCode=XX&mobileNumber=999XXXX875&verificationId=XX&customerId=CXC01XXXXAF1B94F0&code=XXXX"
payload = {}
headers = {
'authToken': 'eyJhbGciOiJIUzUxMiJ9.eyJzdLIiOyQTVGNDlGNzQwNCIsImlhdCI6MTY5NjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrPAFpxEanHkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP5mFvLQzI__uaA'}

response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
{  
     "responseCode": 200,  
    "message": "SUCCESS",  
     "data": {    
            "verificationId":   "20",      
            "mobileNumber":   "8846735392",      
             "verificationStatus":   "VERIFICATION_COMPLETED",      
             "responseCode":  "200",      
             "errorMessage":   null,      
             "transactionId":   null,      
             "authToken":  eyJhbGciOiJIUzUxMiJ9.eyJzdLIiDMyQTVGNDlGNzQwNCIsImlhNjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrP64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA
}
}
1
require "uri"
require "net/http"

url = URI("https://cpaas.messagecentral.com/verification/v2/verification/validateOtp?countryCode=XX&mobileNumber=999XXXX875&verificationId=XX&customerId=CXC015XXXXF1B94F0&code=XXXX")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["authToken"] = "eyJhbGciOiJIUzUxMiJ9.eyJzdLIiOiMyQTVGNDlGNzQwNCIsImlhdCI6MTY5NjMxNDXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INAFpxEanH64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NmFvLQzI__uaA"

response = http.request(request)
puts response.read_body
{  
     "responseCode": 200,  
    "message": "SUCCESS",  
     "data": {    
            "verificationId":   "20",      
            "mobileNumber":   "8846735392",      
             "verificationStatus":   "VERIFICATION_COMPLETED",      
             "responseCode":  "200",      
             "errorMessage":   null,      
             "transactionId":   null,      
             "authToken": eyJhbGciOiJIUzUxMiJ9.eyJzdLIiDMyQTVGNDlGNzQwNCIsImlhNjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrP64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA
}
}
1
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://cpaas.messagecentral.com/verification/v2/verification/validateOtp?countryCode=XX&mobileNumber=999XXXX875&verificationId=XX&customerId=CXC0XXXXAF1B94F0&code=XXXX");

request.Headers.Add("authToken", "eyJhbGciOiJIUzUxMiJ9.eyJzdLIiDMyQTVGNDlGNzQwNCIsImlhNjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrP64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
{  
     "responseCode": 200,  
    "message": "SUCCESS",  
     "data": {    
            "verificationId":   "20",      
            "mobileNumber":   "8846735392",      
             "verificationStatus":   "VERIFICATION_COMPLETED",      
             "responseCode":  "200",      
             "errorMessage":   null,      
             "transactionId":   null,      
             "authToken": eyJhbGciOiJIUzUxMiJ9.eyJzdLIiDMyQTVGNDlGNzQwNCIsImlhNjMxNDQzNiwiZXhwIjoxNjk2OTE5MjM2fQ.UDSi6Mpjr5INVGm4SRFrP64AD6JkiAv2zIReANR6pgmGEoo-T4AXXmgpqXjP56NYh6mFvLQzI__uaA
}
}

C. Status Codes

Field
Type
200
Success (Request Received / VERIFICATION_COMPLETED) 
400
Bad Request
404
Resource Not Found
409
Duplicate Response
500
Unknown Response. Please Try again later.
501
INVALID_CUSTOMER_ID
503
INVALID_ISOCOUNTRYCODE
504
INVALID_MOBILE_NUMBERFORMAT
505
INVALID_VERIFICATION_ID
506
REQUEST_ALREADY_EXISTS
507
NO_ACTIVE_DID_FOUND
508
ALL_CREDITS_EXHAUSTED
509
WRONG_CALL_FLOW_INIT_STATE_USED
700
VERIFICATION_FAILED
701
TRYING_FALLBACK
702
WRONG_OTP_PROVIDED
703
ALREADY_VERIFIED
704
NOT_VALID_TYPE_REQUEST
705
TRYING_FALLBACK_SMS_DELIVERED
706
TRYING_FALLBACK_SMS_NOT_DELIVERED
707
SMS_DELIVERED_SUCCESSFULLY
708
SMS_DELIVERY_REPORT_PENDING
709
WRONG_DID_PROVIDED
711
COUNTRY_NOT_SUPPORTED_OTP_SENT
730
SERVICE_NOT_ACTIVE

Ready to get started?

Safeguard your user accounts and build trust with your customers using SMS verification. Try Verify Now without any credit card.

Message Central Logo Blue
Message Central Team
Hi there
How can we help you today?
Start Whatsapp Chat