Spendo API Docs
  • Introduction!
  • Quick Start
  • HTTP
    • SMS
      • Send SMS Local
      • Send SMS International
      • Send SMS OTP
      • Send SMS Bulk
      • AI Messaging
        • Send SMS AI
        • Send SMS Bulk AI
    • Verification
      • BVN Number OTP
      • NIN Number OTP
      • Phone Number Verification
        • Verify Phone Number OTP
    • Whatsapp
      • Whatsapp Message
      • Whatsapp Message Template
      • Whatsapp OTP
    • Voice OTP
      • Voice OTP
  • SMPP
    • SMPP Specification
    • SMPP Servers
    • SMPP Authentication
    • SMPP Configuration
    • SMPP Message PDU
    • SMPP Client Configuration
    • SMPP Sample Code
  • Libraries And SDK's
    • Node.JS SDK
Powered by GitBook
On this page

Was this helpful?

  1. HTTP
  2. Verification
  3. Phone Number Verification

Verify Phone Number OTP

This API allows you to verify the OTP code that was sent to a user's phone number during the phone number verification process.

Phone Number OTP

POST https://api.getspendo.com/gateway/api/v1/verify/phoneCheck

Headers

Name
Type
Description

apiKey*

String

The API key that you get from spendo's dashboard.

Request Body

Name
Type
Description

code*

String

The OTP code that the user entered to verify their phone number, represented as a string.

requestId*

String

The ID of the verification request that was sent to the phone number, represented as a string.

{
  "success": true,
  "message": "Request Succesful",
  "code": 0,
  "data": null
}

{
  "success": false,
  "message": "Error sending OTP",
  "code": 0,
  "data": null
}

Good to know: You can use our API Method block to fully test all the API method.

Take a look at how you might call this method using our official libraries, or via curl:



curl --location --request POST 'https://api.getspendo.com/gateway/api/v1/verify/phoneCheck' \
--header 'apiKey: test_api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
  "code": "string",
  "requestId": "string"
}'
var axios = require('axios');
var data = JSON.stringify({
  "code": "string",
  "requestId": "string"
});

var config = {
  method: 'post',
  url: 'https://api.getspendo.com/gateway/api/v1/verify/phoneCheck',
  headers: { 
    'apiKey': 'test_api_key', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
import http.client
import json

conn = http.client.HTTPSConnection("api.getspendo.com")
payload = json.dumps({
  "code": "string",
  "requestId": "string"
})
headers = {
  'apiKey': 'test_api_key',
  'Content-Type': 'application/json'
}
conn.request("POST", "/gateway/api/v1/verify/phoneCheck", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.getspendo.com/gateway/api/v1/verify/phoneCheck',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "code": "string",
  "requestId": "string"
}',
  CURLOPT_HTTPHEADER => array(
    'apiKey: test_api_key',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"code\": \"string\",\n  \"requestId\": \"string\"\n}");
Request request = new Request.Builder()
  .url("https://api.getspendo.com/gateway/api/v1/verify/phoneCheck")
  .method("POST", body)
  .addHeader("apiKey", "test_api_key")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
var settings = {
  "url": "https://api.getspendo.com/gateway/api/v1/verify/phoneCheck",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "apiKey": "test_api_key",
    "Content-Type": "application/json"
  },
  "data": JSON.stringify({
  "code": "string",
  "requestId": "string"
}),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
PreviousPhone Number VerificationNextWhatsapp

Last updated 2 years ago

Was this helpful?