A new version of the OTP API is available. This version includes email and WhatsApp as channels. Please consider [upgrading](🔗). A subscription is required for this version. Please contact your account manager or our [sales team](🔗).
## Request
### HTTP headers
Header | Description |
X-CM-ProductToken | Your product token. Retrieve from [Messaging Gateway app](🔗). |
Content-Type | application/json |
### Request body
### Parameters
Column Title | Column Title | Column Title | Column Title |
recipient | string | Yes | Phone number in international format. e.g. `0031601234567 `. |
sender | string | Yes | The name or phone number of the sender (min 3, max 11). Please note that alphanumeric sender is not supported in all countries. |
length | integer | No | length of the code (min 4, max 10). default: `5 `. |
expiry | integer | No | expiry in seconds (min 10, max 3600). default: `60 ` seconds. |
allowPush | boolean | No | Allow code to be send via push notification. default: `false `. |
appKey | string | No | The app key GUID. |
allowVoice | boolean | No | Send the code via a voice call. |
voiceLanguage | string | No | Change the language of the voice call. Supported values: `de `, `en `, `es `, `fr `, `it `, `nl `. Default: `en ` |
message | string | No | Set a custom message. You can use the placeholder `{code} ` which will be replaced by the actual code. e.g. `Your code is: {code} `. |
When `
allowPush
` is set to `true
`, a valid app key is required
## Response
### Parameters
Parameter | Description |
id | The unique identifier for the code. Use this in combination with the received code to verify the code. |
createdAt | The date the code was created. |
expireAt | The date the code will expire. |
### Response codes
HTTP status | Description |
200 | Successful request. |
400 | Invalid request, see message in the response. |
500 | Unknown error occurred. |