OTP Verification API
Verify OTP and Register User
Verify the OTP sent to the user's email and register the user.
Request
- Method: POST
- Can be accessed by: Any user with a valid temporary token
- URL:
/api/verification/otp
- Headers:
- Authorization: Bearer
<temp_token>
- Authorization: Bearer
- Body:
{ "otp": "123456" }
Response
- Status: 200 OK
- Body:
{ "success": true, "data": "User registered successfully", "error": null }
Error Responses
-
Unauthorized Access
- Status: 401 Unauthorized
- Body:
{ "success": false, "data": null, "error": "Unauthorized" }
-
Invalid Request Body
- Status: 400 Bad Request
- Body:
{ "success": false, "data": null, "error": "Invalid Request Body. Required fields: otp" }
-
Invalid OTP
- Status: 400 Bad Request
- Body:
{ "success": false, "data": null, "error": "Invalid OTP" }
-
Server Error
- Status: 500 Internal Server Error
- Body:
{ "success": false, "data": null, "error": "An error occurred while processing your request" }