Skip to main content
Version

OTP API v1 (1.0)

Download OpenAPI specification:Download

Protect your organisation and users against fraudulent login attempts and potential catastrophic effects on your business. CM.com offers a unique Hybrid Two-factor, One Time Password solution that can be delivered via our high quality SMS routes, to your app via Push or via a Voice call.

How to start

OTP

Generate code

Generate code

Authorizations:
ProductToken
Request Body schema: application/json
required
recipient
required
string

Phone number in international format without +.

sender
required
string

The name or phone number of the sender. Please note that alphanumeric sender is not supported in all countries. If allowVoice is true, sender must be a phone number. For alphanumeric senders, the length should be between 3 and 11 characters.

length
integer [ 4 .. 10 ]
Default: 5

The length of the code.

expiry
integer [ 10 .. 3600 ]
Default: 60

The expiry in seconds.

allowVoice
boolean

Send the code via a voice call.

voiceLanguage
string
Default: "en"
Enum: "de" "en" "es" "fr" "it" "nl"

Change the language of the voice call.

allowPush
boolean
Default: false

Allow code to be send via push notification. When allowPush is set to true, a valid app key is required.

appKey
string <uuid>

The app key GUID.

message
string

Set a custom message. You can use the placeholder {code} which will be replaced by the actual code. e.g. Your code is: {code}."

Responses

Request samples

Content type
application/json
{
  • "recipient": "0031601234567",
  • "sender": "My company"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "expireAt": "2019-08-24T14:15:22Z"
}

Verify code

Verify code

Authorizations:
ProductToken
Request Body schema: application/json
required
id
string <uuid>

The unique identifier for the code.

code
string

The code received via SMS/Push or Voice.

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "code": "12345"
}

Response samples

Content type
application/json
{
  • "valid": true
}