1.Login/register
url: [your-domain]/wp-json/login-with-phone-number/v1/login
method: GET
body:
username:
here you send phone number with country code:
example of correct: 12124567890
example of incorrect: +1-212-456-7890
method: method is your sms gateway name that you have in this list, for example: firebase, custom or other gateway add-ons
Request body example:
{
"username": 12124567890,
"method":"custom"
}
Response body example:
{
"success": true,
"ID": 2,
"authWithPass": false,
"message": "Message sent!",
"phone_number": 12124567890,
"showPass": false
}
2.Verify
url: [your-domain]/wp-json/login-with-phone-number/v1/verify
method: GET
body:
phone_number: here you send phone number with country code like above example.
secod: activation or verification code that user got it from SMS
Request body example:
{
"phone_number": 12124567890,
"secod": 123456
}
False response body example:
{
"success": false,
"phone_number": "12124567890",
"message": "Activation code is Wrong!"
}
or
True body example:
{
"success": true,
"loggedin" true,
"phone_number": "12124567890",
"message": "loading...",
"token" xxxxxxxxxxxxxxxxxxxxxxxxxxx,
"user_id": 2
}
Leave a Reply