ValidateNotifyCodeVerification
Validates a one-time passcode that a recipient submitted. Validation succeeds when the passcode matches, the validity period has not elapsed, and the maximum number of attempts has not been exceeded.
Request Syntax
POST /v1/notify-code-verifications/validate HTTP/1.1
Content-type: application/json
{
"code": "string",
"destinationIdentity": "string",
"referenceId": "string"
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- code
-
The one-time passcode that the recipient submitted for validation.
Type: String
Length Constraints: Minimum length of 4. Maximum length of 8.
Pattern:
[A-Za-z0-9]+Required: Yes
- destinationIdentity
-
The recipient identifier. For the TEXT and VOICE channels, specify an E.164 phone number. For the WhatsApp channel, specify a WhatsApp address.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 20.
Pattern:
[\x21-\x22\x24-\x7E]+Required: Yes
- referenceId
-
The caller-supplied reference identifier used to locate the verification. This value must match the value that you supplied to the SendNotifyCodeVerification operation.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
[A-Za-z0-9_-]+Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"status": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- status
-
The outcome of the validation attempt. VALID indicates that the submitted passcode matched an active verification. INVALID indicates that the passcode did not match, expired, or exceeded its attempt limit.
Type: String
Valid Values:
VALID | INVALID
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
You do not have sufficient access to perform this action.
HTTP Status Code: 403
- InternalServerException
-
An unexpected error occurred during the processing of the request.
HTTP Status Code: 500
- ThrottlingException
-
The request was denied because it exceeded the allowed request rate.
HTTP Status Code: 429
- ValidationException
-
The input fails to satisfy the constraints specified by the service. Check your request parameters and retry the request.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: