Submit OTP
Last updated
Last updated
phone_number (required)
String
Phone Number for sending OTP. Add 91 before your number.
name (required)
String
Name for Account Login.
action (required)
String
Provide action name which is 'send_otp'
otp (required)
String
Provide the received OTP on your mobile number. This is generated from Login API endpoint.
Sample Request ⬇️ (Body Parameter)
curl --location 'https://matar.in.ngrok.io/api/v1/login' \
--header 'Content-Type: application/json' \
--data '{
"phone_number": "919743256789",
"name": "Sri",
"action": "submit_otp",
"otp": "48793"
}'
Responses ⬇️
Status Code: 🟢200 (200 denotes 'ok')
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjkyNzg2Njg1LCJqdGkiOiJiMjZmNTk2ZC1kOTYwLTQ2ZWMtYmFmNi1jNzkzMGQ5MzUxMjAiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiMzk1MDFUIiwibmJmIjoxNjkyNzg2Njg1LCJleHAiOjE2OTM2NTA2ODV9.iGXVYlasw8UL7UTRUR69lTlznivrpRJdODyTGIza7Og",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTY5Mjc4NjY4NSwianRpIjoiOTE5NzcwN2YtN2NmNi00MzMzLWE1OTUtZGQ0M2EzNWMwZTVlIiwidHlwZSI6InJlZnJlc2giLCJzdWIiOiIzOTUwMVQiLCJuYmYiOjE2OTI3ODY2ODUsImV4cCI6MTY5Nzk3MDY4NX0.4xvD7-O1HcW6yoV3cBsV2cn3VY38Y56lp656kNBQpOA"
}
Status Code: 🔴400 (400 denotes 'Bad request')
{
"message": "Invalid OTP"
}
Response Parameters Description:
The access token requests secure access to the Matar resources whereas a refresh token just helps you re-validate a user without them having to re-enter their login credentials multiple times.
Access token expiry period: 10 days.
Refresh token expiry period: 60 days.