Verfiy Email OTP
Verify OTP
POST https://valifystage.com/api/v1/otp/email/verify/
Headers
Name
Type
Description
Content-Type
string
application/json
Authorization
string
Bearer <access-token>
Request Body
Name
Type
Description
Notes
data
object
Object containing the parameters below:
{
otp: <str>,
bundle_key: <str>,
lang: <str>
transaction_id: <str>
}
-otp: 6 digit OTP entered by the user.
-The transaction ID from the "Send Email OTP" step.
Status Codes
{
'verified': true
}{
"message": "Bad Request – invalid request received (e.g. missing Bundle key, required parameters or invalid json) | Make sure all the required parameters are included"
}{
"message": "Unauthorized – your Bundle key is invalid"
}{
"message": "Forbidden – specified access_token could not be found"
}{
"message": "Not Found"
}{
"message": "Unsupported Media Type"
}{
"message": "<error-description>",
"error_code": <valify-error-code>
}{
"message": "Internal Server Error"
}Code Snippets
import requests
import base64
token = '<token>' # Place your token here
data = {
'otp': '<otp>', # Place the received OTP here
'transaction_id': '<transaction id from "Send OTP">', # Place the transaction ID here
'bundle_key': '<bundle key>', #Place the bundle key here
'lang': '<str>' # optional, default: en
}
r = requests.post("https://valifystage.com/api/v1/otp/email/verify/",
json=data,
headers={'Authorization': 'Bearer %s' % token}
)
print(r.json())Last updated