Skip to main content

Validate

Validate the OTP received in WhatsApp, follow the next steps.

OTP Validation API

Endpoint POST https://apiwa.nuverax.com/api/v1/otp/verify

Payload Request

PropertyRequiredDescription
codeYour OTP to validate.
code_verifierPKCE Code verifier value. Required only if the initial request included code_challenge.

Example Request

curl --location 'https://apiwa.nuverax.com/api/v1/otp/verify' \
--header 'Api-Key: [YOUR_API_KEY]' \
--header 'Content-Type: application/json' \
--data '{
"code": "[YOUR_OTP_CODE_TO_VALIDATE]"
}'
info

You will need to get a valid Prod or Dev API Key to call the API. Read the next documentation to see how.

Payload Response

PropertyDescription
successfulTrue if the OTP validation was successful.
id_tokenToken Id on JWT format, includes useful information on the payload.

Id Token Payload

PropertyDescription
expExpiration time of the JWT (24 hours by default).
iatCreatiion time of the JWT.
subUser account Id.
envEnvironment of the JWT (It could be production or development).
audProgrammable OTP application id.
issThe issuer of the JWT (https://wa.nuverax.com by default).
nonceNonce value previously generated by the client application.
is_customTrue if the JWT was created by a Programmable OTP application.
p_hashPhone number hash (SHA-256 of the registered phone number including country code). For example country_code=52 and phone_number=5512345678 the final phone number is 525512345678 so the SHA-256 is 8f9d0944329b5338c6fb86f293ceb39385b596254748dd3628ec62f55c334811