OTP/Phone verification
Last updated
Last updated
Besides sending SMS, TextLink API can automate one-time-password (OTP) verification for phone numbers. The pricing for OTP verification is the same as sending a normal SMS, but we give OTP messages higher priority and faster delivery times.
The main perk of using our solution for verifying phone number is the removal of need to store the valid codes in your database, since we can verify codes for you.
To send a verification SMS, you can send the following POST request with tool of your choice (like Postman), or use any of the programming languages that support REST API calls.
POST
https://textlinksms.com/api/send-code
Content-Type*
The value should be "application/json"
Authorization*
phone_number*
String
Recipient phone number, with country prefix. E.g. +11234567890
service_name
String
Your name to be shown in the message
source_country
String
expiration_time
Integer
How long the code is valid, in miliseconds
After you have sent the one-time-password to your user, you can prompt him to enter the code in your website or application. After he has entered the code, you can use the /verify-code
endpoint, to check if it is valid, without having to store the code locally.
POST
https://textlinksms.com/api/verify-code
Content-Type*
The value should be "application/json"
Authorization*
phone_number*
String
The phone number that you would like to verify
code
String
The OTP code to verify
The value should be "Bearer API_KEY", where API_KEY is the API key that you have registered on the
Uppercase of the sender phone number country. If left out, the cheapest option will be used.
The value should be "Bearer API_KEY", where API_KEY is the API key that you have registered on the