Generate OTP
POST /generateOTP
Request Body
{
"phone_no": "09xxxxxxxxx",
"country_prefix": "95",
"app_id": "[YOUR APP ID]",
"hash": "[HAHS VALUE]"
}
Description
| Name | Description |
|---|---|
| phone_no | Myanmar mobile number only. Start with 09 |
| country_prefix | 95 only |
| app_id | APP ID from OTP SMS |
| hash | HMAC("SHA256",phone_no + app_id,APP SECRET) |
Example Hash
- PHP
- NodeJs
- TypeScript
$strValue = $phone_no.$app_id;
$hashValue = hash_hmac('sha256', $strValue, $app_secret);
const crypto = require('crypto');
const phoneNo = '1234567890'; // Replace with the actual phone number
const appId = 'abcdef'; // Replace with the actual app ID
const appSecret = 'mysecretkey'; // Replace with the actual app secret
const strValue = phoneNo + appId;
const hashValue = crypto.createHmac('sha256', appSecret).update(strValue).digest('hex');
import crypto from 'crypto';
const phoneNo: string = '1234567890'; // Replace with the actual phone number
const appId: string = 'abcdef'; // Replace with the actual app ID
const appSecret: string = 'mysecretkey'; // Replace with the actual app secret
const strValue: string = phoneNo + appId;
const hashValue: string = crypto.createHmac('sha256', appSecret).update(strValue).digest('hex');
Response
{
"error": false,
"account_id": 6451673,
"resend_time_interval": 2
}
Description
| Name | Description |
|---|---|
| error | Will return success or fail |
| account_id | Account Id for phone number. Use for checking OTP |
| resend_time_interval | When allow to resend the same phone number. |