Skip to content

Check a verification code

POST
/v1/Account/{auth_id}/VerificationsCheck
curl --request POST \
--url https://api.siprtc.io/v1/Account/example/VerificationsCheck \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "code": "482913", "dst": "+15555550123" }'

Checks the code your user entered against the verification last sent to dst from your account with POST /Account/{auth_id}/Verifications. A matching code answers 200 with status success and marks the verification verified; a wrong code answers 401 with status failed and marks it failed, but the code stays valid until it expires, so the user can try again. Codes expire 2 minutes after the last send: after that, or for a number no code was sent to, the answer is 400. dst must be written exactly as in the send request.

auth_id
required
string

Your account Auth ID (20 characters)

The number and the code the user entered

Media type application/json
object
code
required

The code your user entered, digits only.

string

Example

482913
dst
required

The number the code was sent to, written exactly as in the send request.

string

Example

+15555550123

Code matches: status success

Media type application/json
object
message

“otp is verified” or “otp is not verified”.

string
status

Success when the code matches, failed when it does not.

string
Allowed values: success failed
verifyid

ID of the send the code belongs to.

string

Example

{
"message": "otp is verified",
"status": "success",
"verifyid": "9b2f6c1e-3d4a-4f5b-8c7d-0e1f2a3b4c5d"
}

Body is not valid JSON, dst or code is missing, or no code is pending for dst (never sent, or expired)

Media type application/json
object
error

Why the request was refused: a JSON or validation error, or a cache miss when no code is pending for the number.

string
verifyId

Send requests only: ID of the refused request.

string

Example

{
"error": "Key: 'VerifyRequest.Destination' Error:Field validation for 'Destination' failed on the 'required' tag",
"verifyId": "9b2f6c1e-3d4a-4f5b-8c7d-0e1f2a3b4c5d"
}

Code does not match: status failed (also used by the API gateway for wrong credentials, with a plain string body)

Media type application/json
object
message

“otp is verified” or “otp is not verified”.

string
status

Success when the code matches, failed when it does not.

string
Allowed values: success failed
verifyid

ID of the send the code belongs to.

string

Example

{
"message": "otp is verified",
"status": "success",
"verifyid": "9b2f6c1e-3d4a-4f5b-8c7d-0e1f2a3b4c5d"
}