Verify the phone number using a verification code. This endpoint is a crucial part of the user enrollment process to ensure the user’s phone number is verified.
Endpoint Overview #
URL:
https://auth-test.10npay.com/api/v1/User/phone-number/verify
HTTP Method: POST
Headers:
accept: application/json
Authorization: Bearer {token}
Content-Type: application/json
Request Body #
id (integer): The user ID.
code (string): The verification code sent to the user’s phone.
Request Body Example:
{
"id": 176,
"code": "123456"
}
Curl Command Example:
curl -X 'POST' \ 'https://auth-test.10npay.com/api/v1/User/phone-number/verify' \ -H 'accept: application/json' \ -H 'Authorization: Bearer {Token}' \ -H 'Content-Type: application/json' \ -d '{"id":176,"code":"123456"}'
Responses #
Success Response #
Status Code: 200 OK
Response Body:
{}
Error Responses #
Status Code: 400 Bad Request
Response Body:
{
"errors": {
"Error": [
"UserNotFound"
]
},
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "Bad Request",
"status": 400,
"traceId": "00-ba28c2fc45c68f3b1a191ae0456f2da3-7c17024377450b80-01"
}
Status Code: 400 Bad Request
Response Body:
{
"errors": {
"Code": [
"The Code field is required."
]
},
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-bc2a3b1e44e9877af6ec9036086a510b-edc29966c41ed89e-01"
}
Purpose of Verifying Phone Number #
The purpose of calling the https://auth-test.10npay.com/api/v1/User/phone-number/verify endpoint is to verify the user’s phone number using the verification code sent to their phone. This is a crucial step in the user enrollment process to ensure that the phone number provided is valid and belongs to the user.
Summary
Prepare the request with the appropriate headers, including the Bearer token for authorization.
Send the request using the specified endpoint and method, including the user ID and verification code in the request body.
Handle the response by checking the status code and response body. If successful, the user’s phone number is verified. If an error occurs, use the provided error messages to identify and resolve the issue.