Textlocal Logo

API Documentation

Send a One Time Password

This command can be used to send text messages to an individual with a one-time password. To validate the OTP with Textlocal, see the otp_challenge API call

Resource URL

https://api.txtlocal.com/otp_send/

Sample Request

Sorry, we do not have an example for POST in the language you have chosen.

Sorry, we do not have an example for GET in the language you have chosen.

Sorry, we do not have an example for Class in the language you have chosen.

Caution: Some users opt to place their request inside a code loop, while testing we highly recommend setting the test parameter to true, as occasionally an infinite loop can occur and users can consume all their credits very quickly.

Parameters

sender Use this field to specify the sender name for your message. This must be at least 3 characters in length but no longer than 11 alphanumeric characters or 13 numeric characters.
message The message content that prefixes the OTP. This parameter should be no longer than 760 characters. See Helpful Information for message length details. The message also must be URL Encoded to support symbols like &.
Login Parameters (Additional Information)
apiKey You can create these in your Messenger Control Panel (click here) for each application, and limit the usage of them by host IP Address.
numbers The mobile number to receive the OTP in international format (i.e. 447123456789).

Sample Response

Sorry, we do not have a sample response for JSON.

Sorry, we do not have a sample response for XML.

Errors

Error Codes
4 No recipients specified.
5 No message content.
6 Message too long.
7 Insufficient credits.
32 Invalid number format.
43 Invalid sender name.
44 No sender name specified.
51 No valid numbers specified.

Warnings

Warning Codes
3 Invalid number.