Skip to main content
Version

OTP as a Service API (2)

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, or email message.

How to start

OTP

Create code

Create code

Authorizations:
ProductToken
Request Body schema: application/json
required
Any of
channel
required
string
Value: "sms"

The channel to send the code.

from
required
string

The number or name of the sender. This must be a valid phone number in E.164 format or an alphanumeric string between 3 and 11 characters. Please note that alphanumeric senders are not supported in all countries.

to
required
string

The receiver of the code. This must be a valid phone number in E.164 format.

message
string <= 160 characters

Set a custom message. You can use the placeholder {code}, this will be replaced by the actual code.

digits
integer [ 4 .. 10 ]
Default: 5

The length of the code.

expiry
integer [ 10 .. 3600 ]
Default: 60

The expiry of the code in seconds.

Responses

Request samples

Content type
application/json
Example
{
  • "channel": "sms",
  • "from": "+31601234567",
  • "to": "+31602345678",
  • "message": "Your code is: {code}",
  • "digits": 5,
  • "expiry": 60
}

Response samples

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

Verify code

Verify code

Authorizations:
ProductToken
path Parameters
id
required
string <uuid>
Example: 5924b029-6ede-4cb9-a252-0440a85fd350

The identifier of the OTP

Request Body schema: application/json
required
code
required
string

The code received via the specified channel.

Responses

Request samples

Content type
application/json
{
  • "code": "12345"
}

Response samples

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