Initiate

This endpoint is the starting point of the OTP service, initiating an OTP request (message) to send it to a specific recipient.

post
Authorizations
x-auth-tokenstringRequired
Body
phoneNumberstringRequired
lengthnumber · enumRequired

4 or 6 digits code

Default: 4Possible values:
expirationnumberRequired

in seconds

Default: 300
clientOsstring · enumRequired

Operating system of the client

Default: OTHERPossible values:
languagestring · enumRequired

Language of the client

Default: ENPossible values:
operationstringRequired

OTP type

senderIdstringRequired
Responses
post
/public/otp/initiate
POST /public/otp/initiate HTTP/1.1
Host: api.marsol.ly
x-auth-token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 122

{
  "phoneNumber": "text",
  "length": 4,
  "expiration": 300,
  "clientOs": "OTHER",
  "language": "EN",
  "operation": "text",
  "senderId": "text"
}
201Success
{
  "expiration": 1,
  "price": 1,
  "requestId": "text",
  "resendToken": "text"
}

Endpoint: /public/otp/initiate

Method: POST

Description: Initiate a new OTP request.

Request Body:

  • phoneNumber (string): The recipient phone number.

  • length (number): The length of OTP code.

  • expiration (number): The Expiration period of the OTP code, the expiration length could be: 120, 300, 600 second.

  • clientOs (enum): The operating system of the client.

POST /public/otp/initiate HTTP/1.1
Host: api.marsol.ly
x-auth-token: your_api_token_here
Content-Type: application/json
{
    "phoneNumbers": "text",
    "length": 4,
    "expiration": 300,
    "clientOs": "text",
    "language": "enum",
    "operation": "text",
    "senderId": "text"
}

Response:

  • expiration (number): The Expiration period of the OTP code.

  • price (number): The price of the OTP request.

  • requestId (string): The unique identifier of the OTP request.

  • resendToken (string): The token used to resend the OTP request.

{
  "expiration": 0,
  "price": 0,
  "requestId": "string",
  "resendToken": "string"
}

Last updated