Skip to content
Get started

Verifies the OTP received as input

client.otpvalidation.validateCode(OtpvalidationValidateCodeParams { authenticationId, code, xCorrelator } params, RequestOptionsoptions?): void
POST/otpvalidation/validate-code

Verifies the code is valid for the received authenticationId

ParametersExpand Collapse
params: OtpvalidationValidateCodeParams { authenticationId, code, xCorrelator }
authenticationId: string

Body param: unique id of the verification attempt the code belongs to.

maxLength36
code: string

Body param: temporal, short code to be validated

maxLength10
xCorrelator?: string

Header param: Correlation id for the different services

Verifies the OTP received as input

import Camara from 'camara-sdk';

const client = new Camara({
  bearerToken: process.env['CAMARA_BEARER_TOKEN'], // This is the default and can be omitted
});

await client.otpvalidation.validateCode({
  authenticationId: 'ea0840f3-3663-4149-bd10-c7c6b8912105',
  code: 'AJY3',
});
{
  "status": 400,
  "code": "OUT_OF_RANGE",
  "message": "Client specified an invalid range."
}
{
  "status": 400,
  "code": "INVALID_ARGUMENT",
  "message": "Client specified an invalid argument, request body or query param"
}
{
  "status": 400,
  "code": "ONE_TIME_PASSWORD_SMS.VERIFICATION_FAILED",
  "message": "The maximum number of attempts for this authenticationId was exceeded without providing a valid OTP"
}
{
  "status": 400,
  "code": "ONE_TIME_PASSWORD_SMS.VERIFICATION_EXPIRED",
  "message": "The authenticationId is no longer valid"
}
{
  "status": 400,
  "code": "ONE_TIME_PASSWORD_SMS.INVALID_OTP",
  "message": "The provided OTP is not valid for this authenticationId"
}
{
  "status": 401,
  "code": "UNAUTHENTICATED",
  "message": "Request not authenticated due to missing, invalid, or expired credentials."
}
{
  "status": 403,
  "code": "PERMISSION_DENIED",
  "message": "Client does not have sufficient permissions to perform this action."
}
{
  "status": 404,
  "code": "NOT_FOUND",
  "message": "The specified resource is not found."
}
{
  "status": 429,
  "code": "QUOTA_EXCEEDED",
  "message": "Out of resource quota."
}
{
  "status": 429,
  "code": "TOO_MANY_REQUESTS",
  "message": "Rate limit reached."
}
Returns Examples
{
  "status": 400,
  "code": "OUT_OF_RANGE",
  "message": "Client specified an invalid range."
}
{
  "status": 400,
  "code": "INVALID_ARGUMENT",
  "message": "Client specified an invalid argument, request body or query param"
}
{
  "status": 400,
  "code": "ONE_TIME_PASSWORD_SMS.VERIFICATION_FAILED",
  "message": "The maximum number of attempts for this authenticationId was exceeded without providing a valid OTP"
}
{
  "status": 400,
  "code": "ONE_TIME_PASSWORD_SMS.VERIFICATION_EXPIRED",
  "message": "The authenticationId is no longer valid"
}
{
  "status": 400,
  "code": "ONE_TIME_PASSWORD_SMS.INVALID_OTP",
  "message": "The provided OTP is not valid for this authenticationId"
}
{
  "status": 401,
  "code": "UNAUTHENTICATED",
  "message": "Request not authenticated due to missing, invalid, or expired credentials."
}
{
  "status": 403,
  "code": "PERMISSION_DENIED",
  "message": "Client does not have sufficient permissions to perform this action."
}
{
  "status": 404,
  "code": "NOT_FOUND",
  "message": "The specified resource is not found."
}
{
  "status": 429,
  "code": "QUOTA_EXCEEDED",
  "message": "Out of resource quota."
}
{
  "status": 429,
  "code": "TOO_MANY_REQUESTS",
  "message": "Rate limit reached."
}