Check an OTP that was generated with Generate OTP.
https://telcomw.com/api-v2/v1.verify_otpSend the parameters as headers.
| 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. |
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())
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
}
}