🚧 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 .
POST https://api.cm.com/v1.0/otp/generate
Header Description X-CM-ProductToken Your product token. Retrieve from Messaging Gateway app . Content-Type application/json
JSON
{
"recipient": "0031601234567",
"sender": "My company"
}
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
JSON
{
"id": "1e12cb10-d14a-4cd6-8d86-e5263cf122ee",
"createdAt": "2022-01-01T13:00:00+0000",
"expireAt": "2022-01-01T13:01:00+0000"
}
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.
HTTP status Description 200 Successful request. 400 Invalid request, see message in the response. 500 Unknown error occurred.