Skip to main content

Check OTP

POST /checkOTP

Request Body

{
"otp_code" : 447289,
"account_id" : "6451673",
"type" : 2,
"hash" : "fccfafc3eb879d9306edcf548cc3d8f7c2ea833d5d8f1a2110969ce138bf9ec3"
}

Description

NameDescription
otp_codeOTP code that user received
account_idAccount ID from generated otp
type1 for token to check hash , 2 for non hashing
hashHash value for request

Hash

$strValue = $otp_code.$account_id;
$hashValue = hash_hmac('sha256', $strValue, $app_secret);

Response Type 1

{
"error": false,
"token": "8d52c2ea7a126396c6df8566e3081aa33f30901699943180bbffd42da189b6c5",
"hash": "396da26aaa85e90c30a1d3abe7c9190d75c595d31a52ef2d90e1c4068e130f4c",
"phone": {
"number": "+959974274616",
"country_prefix": "95",
"national_number": "9974274616"
},
"expire_time": 1714498494
}

To check hash value use with token

$hashValue = hash_hmac('sha256', $token, $secretKey); //To confirm

Response Type 2

{
"error": false,
"created_at": 1711820011,
"phone": {
"number": "+959974274616",
"country_prefix": "95",
"national_number": "9974274616"
},
"application": {
"id": "974658516625303"
}
}