POST
/
otp
/
request_token
curl --request POST \
  --url https://api.simpu.co/otp/request_token \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "recipient": "2348023456789",
  "length": 6,
  "expires_in": 30,
  "token": "123456"
}'
{
  "id": "674535b2b39158b9aae90188fcec23eb",
  "recipient": "2348023456789",
  "status": 1,
  "status_desc": "SENT",
  "created_datetime": "2024-06-28T23:56:38.128604+00:00",
  "updated_datetime": "2024-06-28T23:56:38.128604+00:00"
}

Authorizations

Authorization
string
header
required

An API key to authenticate requests

Body

application/json
OTP request object
recipient
string
required

Recipient of the OTP token

Example:

"2348023456789"

length
number
default:4

Length of the OTP token

Required range: 4 <= x <= 8
Example:

6

expires_in
number
default:15

Time in minutes before the OTP token expires

Required range: 1 <= x <= 60
Example:

30

token
string

The OTP token to send to the recipient, if not specified, a new token will be generated

Example:

"123456"

Response

200
application/json
OTP response
id
string
required

ID of the OTP token

Example:

"674535b2b39158b9aae90188fcec23eb"

recipient
string
required

Recipient of the OTP token

Example:

"2348023456789"

status
number
required

Status of the OTP token

Example:

1

status_desc
string
required

Description of the status of the OTP token

Example:

"SENT"

created_datetime
string
required

Date and time the OTP token was created

Example:

"2024-06-28T23:56:38.128604+00:00"

updated_datetime
string

Date and time the OTP token was last updated, if any

Example:

"2024-06-28T23:56:38.128604+00:00"