Skip to main content

Send OTP

POST : http://<base_url>/digipay/v3/auth/send_otp

This API is used to send OTP to the user irrespective of the user is registerered or not

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
emailStringEmail address of the user.john.doe@example.com"

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/send_otp \
--header 'Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2NWY0ZDI1MDliZmU0NTBmYTg4MTVhNTU5Njk3YmM0NyIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNjkzNTIxOTU1fQ.9oWwUzlFzmYB1ZOhaVamxKJH6DsMO8tFue2kbg2YyoI' \
--header 'CompanyID: 76bc712200ca444fa334f9e55e5fd7a8' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"dial_code": "+1+1",
"phone_number": "555-123-4567",
"user_type": 2,
"otp_type": 1,
"email": "user@example.com"
}
'

Response:-

Response 200(OK)

{
"success": 1,
"error": [],
"data": {
"message": "OTP is sent to your mobile number."
}
}
Response 400(BAD REQUEST)
{
"success": 0,
"error"": [1],
"data": {
"message": "BAD_REQUEST",
}
}

RESPONSES :-

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