Integrate
Integrate in your code the custom OTP generation, follow the next steps.
OTP Generation API
Endpoint POST https://apiwa.nuverax.com/api/v1/otp
Payload Request
| Property | Required | Description |
|---|---|---|
country_code | ✅ | Country code from the phone number. |
phone_number | ✅ | Phone number with 10 digits (eg. 5512345678). |
nonce | ❌ | A random string generated by your application, which you’ll verify later included in the Token Id. |
code_challenge | ❌ | PKCE Code challenge value. We fully recomend to implement PKCE. Read more about PKCE generation here. code_verifier will be requiered on the OTP verify step. |
Example Request
- cURL
- Js fetch
curl --location 'https://apiwa.nuverax.com/api/v1/otp' \
--header 'Api-Key: [YOUR_API_KEY]' \
--header 'Content-Type: application/json' \
--data '{
"country_code": "[VALID_COUNTRY_CODE]",
"phone_number": "[VALID_PHONE_NUMBER]"
}'
var myHeaders = new Headers();
myHeaders.append("Api-Key", "[YOUR_API_KEY]");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"country_code": "[VALID_COUNTRY_CODE]",
"phone_number": "[VALID_PHONE_NUMBER]"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw
};
fetch("https://apiwa.nuverax.com/api/v1/otp", requestOptions)
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.log('error', error));
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
| Property | Description |
|---|---|
id | OTP Id. |