Overview
This API provides stateless OTP-based mobile authentication.
- HTTPS Required
- JSON Requests Only
- No Session Required
1️⃣ Send OTP
POST https://api.kesportal.com/mobile/authapi.php
Request Body
{
"action": "sendOtp",
"phone_number": "8178802767",
"countryCode": "+91"
}
Success Response
{
"status": true,
"message": "OTP sent successfully",
"authCode": 8778,
"isNewUser": false
}
Failure Response
{
"status": false,
"message": "Failed to send OTP"
}
2️⃣ Verify OTP
POST https://api.kesportal.com/mobile/authapi.php
Request Body
{
"action": "verifyOtp",
"phone_number": "8178802767",
"countryCode": "+91",
"authCode": 8778,
"otp": 884145
}
Success Response
{
"status": true,
"message": "OTP Verified Successfully"
}
Invalid OTP
{
"status": false,
"message": "Invalid OTP (2 attempts remaining)",
"attemptsRemaining": 2
}
Response Codes
| HTTP Code | Description |
|---|---|
| 200 | Success |
| 400 | Invalid OTP |
| 401 | Unauthorized |
| 500 | Server Error |