Use this method to send an otp.
if otpType = SMS an otp code is sent to phone number of the holder defined in theDisposableContacts object.
if otpType = EMAIL an otp code is sent to email of the holder defined in the DisposableContacts object.
if otpType = WHATSAPP an otp code is sent via WhatsApp to the phone number of the holder defined in the DisposableContacts object.
To use the templateId/language pair it is mandatory to define and config these value in the settings before using them.
For the full technical reference, see the OpenAPI specification.
POST /api/certificate/sendOtp| Name | Required | Description |
|---|---|---|
Content-Type | Yes | Must be application/json. |
Authorization | Yes | Basic Auth credentials. |
| Parameter | Type | Required | Description |
|---|---|---|---|
certIdOtp | integer | Yes | The identification of the OTP associated to the disposable. |
deviceCode | string | Yes | The device code of the issued certificate. |
smsOptions | object | Depends | Required if otpType=SMS. Properties: textSMS, templateId (template identifier), language (ISO 639-1 alpha-2). templateId and language are required if textSMS is omitted or empty. Adding $OTP$ in textSMS inserts the OTP at that position; otherwise it is appended at the end. |
emailOptions | object | Depends | Required if otpType=EMAIL. Properties: templateId (required), language (required, ISO 639-1 alpha-2). |
whatsappOptions | object | Depends | Required if otpType=WHATSAPP. Properties: templateId (integer, required), language (ISO 3166-1 alpha-2, required), parameters (array, required — list of template parameters as key-value maps, use $OTP$ as placeholder for the OTP code). |
{
"certIdOtp": 2587763,
"deviceCode": "RHIDP2412063503288",
"smsOptions": {
"textSMS": "Your OTP code: $OTP$"
}
}200 — Success
Empty body
The main errors that can be found within this function are (all return HTTP 500):
| Error code | Description |
|---|---|
| 2 | Some required fields are missing |
| 6 | Generic exception — internal exception |
| 62 | The certIdOtp is not valid |
| 66 | The device OTP is not active |
| 71 | The device OTP is disabled |
| 85 | The deviceCode is not valid |
| 99 | OTP was not sent |
| 100 | The mobile phone number is not valid |
| 101 | SMS blocked by the watchlist |
| 102 | The email address is not valid |
| 103 | The OTP service has exceeded the timeout |
| 138 | The device OTP is not an SMS OTP device |
| 231 | OTP is blocked |
| 241 | LRA not authorized to use this OTP type |
For authentication errors, see Authentication.
For details on how to handle errors, see How to handle errors.