After checking the user’s email and phone number verification status, if the email is not confirmed, the next step is to confirm the email using the verification code sent to the user’s email address.
Step 1: Prepare the Request #
URL:
https://auth-test.10npay.com/api/v1/User/email/confirm
HTTP Method: POST
Headers:
accept: */*
Content-Type: application/json-patch+json
Authorization: Bearer {token}
Request Body:
{
"id": "string",
"token": "string"
}
Example:
{
"id": "172",
"token": "123456"
}
Step 2: Send the Request #
Use a tool like curl, Postman, or your preferred HTTP client to send the request.
Here’s a curl example:
curl -X 'POST' \ 'https://auth-test.10npay.com/api/v1/User/email/confirm' \ -H 'accept: */*' \ -H 'Authorization: Bearer {Token}' \ -H 'Content-Type: application/json-patch+json' \ -d '{"id":"172","token":"123456"}'
Step 3: Handle the Response #
Success Response: #
Status Code: 200 OK
Response Body:
{}
Error Responses: #
User Not Found:
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-c2baa7e961fd796dd5e6b2106b98b861-daeb8017b64bb693-01"
}
Token Missing, Null, or Empty:
Status Code: 400 Bad Request
Response Body:
{
"errors": {
"Token": [
"The Token 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-b8c13dbd0f67d6e189016d853d4b31b7-8ec531d6fd882843-01"
}
Purpose of Email Confirmation #
The purpose of calling the https://auth-test.10npay.com/api/v1/User/email/confirm endpoint is to confirm the user’s email address using a verification code. This step is crucial to ensure that the user has access to the email address they provided and to complete the email verification process.
Summary
Prepare the request with the appropriate headers and body, including the user ID and email verification token.
Send the request using your preferred HTTP client.
Handle the response by checking the status code and response body. If successful, the email is confirmed. If an error occurs, use the provided error messages to identify and resolve the issue.