REST API
You can easily send SMS and verify users with our intuitive API
Last updated
You can easily send SMS and verify users with our intuitive API
Last updated
To be able to use TextFlow for sending an SMS or user verification, you first have to register an account, after that you are going to get a free API key with two free SMS, which you can use to send SMS or verify user request anywhere in the world.
After you have registered an account, your API key will be available on the API console.
POST
https://textflow.me/api/send-sms
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
There are two endpoints that you should call in the user verification process.
/send-code
is used to send user the verification code, while the /verify-code
is used to check if the code that the user has entered is valid.
When you call the /send-code
endpoint, we will send an SMS to the specified phone number. It should be the phone number that you want to verify, e.g. the phone number the user has entered in your app.
After sending the verification SMS, you can show the user a form where he should enter the verification code that he should have got in the SMS. When he submits the code, you should call the /verify-code
endpoint from your backend and supply his phone number (which he can send again when submitting the code) along with the code that you want verified.
That way, you do not have to worry about keeping data about phone verification in your database, because we are doing it for you.
POST
https://textflow.me/api/send-code
POST
https://textflow.me/api/verify-code
You can aslo use the TextFlow API to send one SMS to multiple recipients. It is similar to send-sms
, but with the array of phone numbers which you want to receive the message.
POST
https://textflow.me/api/bulk-sms
After starting the "Send bulk SMS job", you can check the number of recipients that have not yet received the SMS, but should receive them in a few minutes or hours, depending on the server load.
POST
https://textflow.me/api/bulk-count
If you need help installing or using the library, please check the FAQ first, and contact us at [email protected] if you don't find an answer to your question.
If you've found a bug in the API, package or would like new features added, you are also free to contact us!
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Content-Type*
The value should be "application/json"
Authorization*
The value should be "Bearer API_KEY", where API_KEY is the API key that you have registered on the API console
phone_number*
String
Recipient phone number, with country prefix. E.g. +11234567890
text*
String
Message body
Content-Type*
String
The value should be "application/json"
Authorization*
String
The value should be "Bearer API_KEY", where API_KEY is the API key that you have registered on the API console
phone_number*
String
Phone number to verify, with country prefix. E.g. +11234567890
service_name
String
What the user will see in the verification message. If the service_name
is "Guest", he would get the following message:
Your verification code for Guest is: CODE
Default is none
seconds
Integer
How many seconds is the code valid for. Default is 10 minutes. Maximum is one day.
Content-Type*
String
The value should be "application/json"
Authorization*
String
The value should be "Bearer API_KEY", where API_KEY is the API key that you have registered on the API console
phone_number*
String
Phone number to verify the code for, with country prefix. E.g. +11234567890
code*
String
Verification code that the user has submited.
Content-Type*
The value should be "application/json"
Authorization*
The value should be "Bearer API_KEY", where API_KEY is the API key that you have registered on the API console
phone_numbers*
String Array
Recipient phone numbers, with country prefixes. E.g. ["+11234567891", "+11234567892", "+11234567893"]
text*
String
Message body
Content-Type*
The value should be "application/json"
Authorization*
The value should be "Bearer API_KEY", where API_KEY is the API key that you have registered on the API console