Verify generated OTP

Legacy APIs - WhatsApp
Legacy WhatsApp API We only offer this type of WhatsApp API to customers who specifically request it. We have now moved to the official WhatsApp. To use official WhatsApp, contact us on WhatsApp +265992026866.
Starting a new integration? This is a legacy API. It stays available for existing integrations, but new integrations should use the SMS V3 APIs.

Check an OTP that was generated with Generate OTP.

POSThttps://telcomw.com/api-v2/v1.verify_otp

Send the parameters as headers.

Parameters

Parameter Sent in Required Description
code header YES The OTP the user typed in.
ref header YES The reference returned when the OTP was generated.
key header YES Your API key.
password header YES Your account password.

Example request

curl --location --request POST 'https://telcomw.com/api-v2/v1.verify_otp' \
  --header 'code: 20698' \
  --header 'ref: 103495' \
  --header 'key: YOUR_API_KEY' \
  --header 'password: YOUR_PASSWORD'
curl --location --request POST "https://telcomw.com/api-v2/v1.verify_otp" ^
  --header "code: 20698" ^
  --header "ref: 103495" ^
  --header "key: YOUR_API_KEY" ^
  --header "password: YOUR_PASSWORD"
<?php

$headers = [
    'code: 20698',
    'ref: 103495',
    'key: YOUR_API_KEY',
    'password: YOUR_PASSWORD',
];

$ch = curl_init('https://telcomw.com/api-v2/v1.verify_otp');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

print_r(json_decode($response, true));
const axios = require('axios');

axios.request({
  method: 'post',
  url: 'https://telcomw.com/api-v2/v1.verify_otp',
  headers: {
    'code': '20698',
    'ref': '103495',
    'key': 'YOUR_API_KEY',
    'password': 'YOUR_PASSWORD'
  }
}).then((res) => console.log(res.data))
  .catch((err) => console.error(err.response ? err.response.data : err.message));
import requests

headers = {
    'code': '20698',
    'ref': '103495',
    'key': 'YOUR_API_KEY',
    'password': 'YOUR_PASSWORD'
}

response = requests.request('POST', 'https://telcomw.com/api-v2/v1.verify_otp', headers=headers)
print(response.json())

Response

The response is JSON.

{
  "status": 200,
  "message": "OTP successfully verified",
  "feedback": {
    "otp_code": "92187",
    "otp_ref": "460940",
    "otp_status": true,
    "otp_msisdn": "+265992026866",
    "otp_elapse": 4
  }
}