Skip to main content

OTP Verification

POST : https://<base_url>/digipay/v3/auth/verify_otp

This API is used to verify OTP send via send OTP

BODY PARAMS:-

ParameterTypeDescriptionValue
dial_codeStringCountry dial code.+91
phone_numberStringhone number of the user.123456789
user_typeIntType of user (e.g., 1 for employee, 2 for customer)..2
otp_typeIntType of OTP (1 for SMS OTP, 2 for Email OTP, etc.)1
otpStringThe OTP value generated for verification.321465
device_typeIntThe type of device used by the user (e.g., ""android"", ""ios"").2
device_idStringThe device ID associated with the user's device.a1b2c3
device_unique_idStringA unique identifier for the user's device.1234

HEADERS:-

ParameterTypeDescriptionValue
AuthorizationStringIt is a combination of type and token to authenticate user for the given tokenToken duik7309njdlkhdauhknksadhjkas986876sd873j
CompanyIDStringCompany_id is a unique primary id, that is represent company detail76bc712200ca444fa334f9e55e5fd7a8

Request Body:-

Request Example
curl --request POST \
--url http://192.168.1.102:8014/digipay/v3/auth/verify_otp \
--header 'Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2NWY0ZDI1MDliZmU0NTBmYTg4MTVhNTU5Njk3YmM0NyIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNjkzNTIxOTU1fQ.9oWwUzlFzmYB1ZOhaVamxKJH6DsMO8tFue2kbg2YyoI' \
--header 'CompanyID: 76bc712200ca444fa334f9e55e5fd7a8' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"dial_code": "+91",
"phone_number": "555-1234",
"user_type": 2,
"otp_type": 2,
"otp": "321465",
"device_type": 2,
"device_id": "a1b2c3",
"device_unique_id": "1234"
}
'

Response:-

Response 200(OK)

{
"success": 1,
"error": [],
"data": {
"message": "Phone number successfully verified.",
"token": {
"type": "Token",
"token": "eyJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NDc0OTEyMjR9.S_YjH-vZSvv495p5TkRsR3m10fGECdUHGlrXuNNSp-UUmiH-uIm4meYykEiy6BJzvEfjUkZXM3QAZAenQlB2IQ"
},
"user_id": "bccea2ac4114b5aaa790221f72d3799"
}
}
Response 400(BAD REQUEST)
{
"success": 0,
"error"": [1],
"data": {
"message": "BAD_REQUEST",
}
}

RESPONSES :-

Status CodeDescription
200OK
400Bad Request
404Not Found
500Internal Server Error