Check verification
Checks the code against a verification.
Authorization
authorization AuthorizationBearer <token>
In: header
Path Parameters
id*string
The ID of the verification to check against.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
import Surge from '@surgeapi/node';
const client = new Surge({
apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted
});
const verificationCheck = await client.verifications.check('vfn_01jayh15c2f2xamftg0xpyq1nj', {
code: '123456',
});
console.log(verificationCheck.result);{
"result": "ok",
"verification": {
"attempt_count": 1,
"id": "vfn_01jayh15c2f2xamftg0xpyq1nj",
"phone_number": "+18015551234",
"status": "verified"
}
}{
"result": "already_verified"
}{
"result": "incorrect",
"verification": {
"attempt_count": 3,
"id": "vfn_01jayh15c2f2xamftg0xpyq1nj",
"phone_number": "+18015551234",
"status": "exhausted"
}
}{
"error": {
"message": "The requested resource could not be found.",
"type": "not_found"
}
}