TextLink
  • Android setup
  • TextLink dashboard
  • Chat App
  • API
  • GoHighLevel
  • Zapier
  • Make.com
  • Webhooks (handle received SMS + more)
  • Team management (subaccounts)
  • iMessage-specific API
Powered by GitBook
On this page
  • Getting an API key
  • Sending an SMS
  • Using API
  • Using our official packages
  • OTP / Phone verification
  • Using API
  • Using our official packages
  • Check if the code is valid
  • Using API
  • Using our official packages
  • Update contact tag
  • Using API

API

Last updated 2 days ago

TextLink API enables developers to send SMS in a very straightforward and user-friendly way.

Getting an API key

To be able to use TextLink for sending an SMS or user verification, you first have to , after that you are going to get 300 free messages, which you can use to test our API.

After you have registered an account, your API key will be available in the.

Sending an SMS

To send an 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.

Using API

POST https://textlinksms.com/api/send-sms

Headers

Name
Type
Description

Content-Type*

The value should be "application/json"

Authorization*

Request Body

Name
Type
Description

phone_number*

String

Recipient phone number, with country prefix. E.g. +11234567890

text*

String

Message body

sim_card_id

Number

custom_id

String

{
  ok: true
}
{
  ok: false,
  message: "Reason string"
}
{
  ok: true,
  queued: true
}

Using our official packages

// Firstly, install the helper library using  or 

const textlink = require("textlink-sms");
textlink.useKey("YOUR_API_KEY"); // Replace with your API key

textlink.sendSMS("+381611231234", "Dummy message text...");
// Firstly, install the helper library using  or 

import TextLink from "textlink-sms";
TextLink.useKey("YOUR_API_KEY"); // Replace with your API key

TextLink.sendSMS("+381611231234", "Dummy message text...");
# Firstly, install the helper library using 

import textlink as tl

tl.useKey("YOUR_API_KEY") # Replace with your API key

result = tl.sendSMS("+381637443242", "Your message text...")
print(result)

OTP / Phone verification

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.

Using API

POST https://textlinksms.com/api/send-code

Headers

Name
Type
Description

Content-Type*

The value should be "application/json"

Authorization*

Request Body

Name
Type
Description

phone_number*

String

Recipient phone number, with country prefix. E.g. +11234567890

service_name

String

Your name to be shown in the message

sim_card_id

Number

custom_id

String

{
  ok: true,
  code: "123456" // The code sent
}
{
  ok: false,
  message: "Reason string"
}

Using our official packages

// Firstly, install the helper library using  or 

const textlink = require("textlink-sms");
textlink.useKey("YOUR_API_KEY"); // Replace with your API key

const verificationOptions = {
    service_name: "Tribal"
}; // This is optional

await textlink.sendVerificationSMS("+11234567890", verificationOptions);
// Firstly, install the helper library using  or 

import TextLink from "textlink-sms";
TextLink.useKey("YOUR_API_KEY");

const verificationOptions = {
    service_name: "Tribal"
}; // This is optional

await TextLink.sendVerificationSMS("+11234567890", verificationOptions);
# Firstly, install the helper library using 

import textlink as tl

tl.useKey("YOUR_API_KEY") # Replace with your API key

result = tl.sendVerificationSMS("+11234567890", service_name="Tribal")
print(result)

Check if the code is valid

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.

Using API

POST https://textlinksms.com/api/verify-code

Headers

Name
Type
Description

Content-Type*

The value should be "application/json"

Authorization*

Request Body

Name
Type
Description

phone_number*

String

The phone number that you would like to verify

code

String

The OTP code to verify

{
  ok: true
}
{
  ok: false,
  message: "Reason string"
}

Using our official packages

const result = await textlink.verifyCode("+11234567890", "USER_ENTERED_CODE"); 
//if `result.ok` is true, then the phone number is verified. 
const result = await TextLink.verifyCode("+11234567890", "USER_ENTERED_CODE"); 
//if `result.ok` is true, then the phone number is verified. 
result = tl.verifyCode("+11234567890", "USER_ENTERED_CODE")
# if `result.ok` is true, then the phone number is verified.

Update contact tag

Using API

POST https://textlinksms.com/api/update-contect-tag

Headers

Name
Type
Description

Content-Type*

The value should be "application/json"

Authorization*

Request Body

Name
Type
Description

phone_number*

String

The phone number that you would like to update the tag for

tag

String

Tag to set for your contact

{
  ok: true
}

The value should be "Bearer API_KEY", where API_KEY is the API key that you have registered in the

(Optional) Id of the SIM card that you want to send the message from. Can be found in the , by clicking on the device having the SIM card you need

(Optional) Custom id that you want us to send to you in our

Besides , 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 value should be "Bearer API_KEY", where API_KEY is the API key that you have registered on the

(Optional) Id of the SIM card that you want to send the message from. Can be found in the , by clicking on the device having the SIM card you need

(Optional) Custom id that you want us to send to you in our

The value should be "Bearer API_KEY", where API_KEY is the API key that you have registered on the

You can use TextLink API to update contact tags. Contact tags allows you to track status of communication with them (e.g. cold/warm), and can be shown in the Chat app. Besides the chat app, they are also received as a part of , and each change of tag triggers the .

The value should be "Bearer API_KEY", where API_KEY is the API key that you have registered on the

register an account
API console
Received Message Webhook
Tag Update Webhook
sending SMS
API Console
Devices Console
API Console
Devices Console
API Console
API Console
failed message webhook
failed message webhook
This contact has "VIP" tag