Generate and Send OTP

Generates a one-time password and sends it to the given mobile number using the provided message template. The %m placeholder in the message template is replaced with the generated OTP before sending. The OTP can later be verified using the Verify OTP API.

Response Codes

| Code | Meaning | |------|---------| | 1701|MSISDN|MessageID | OTP message sent successfully | | 1702 | One of the parameters is missing, or OTP length is not numeric | | 1703 | Authentication failed | | 1705 | Message does not contain the %m placeholder | | 1706 | Given destination is invalid | | 1707 | Invalid source | | 1710 | Some error occurred | | 1715 | Response timed out | | 1025 | Insufficient user credit | | 1026 | Insufficient reseller credit | | 1027 | Insufficient distributor credit |

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
string
required

Account username.

string
required

Account password.

string
required

Destination mobile number, including country code.

string
required

Message template containing the %m placeholder, which is replaced with the generated OTP. Must be URL-encoded (%m becomes %25m).

string
required

Sender ID assigned to the account.

integer
required

Length of the OTP to generate.

integer
required

OTP validity duration, in seconds.

string

Optional identifier label for this OTP batch.

Responses

400

Bad request — one or more parameters are missing or invalid.

401

Unauthorized — invalid username or password.

500

Internal server error.

Language
Credentials
Query
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain