×
API authentication required
Need API Access?

Please use ‘Create Account’ to quickly register and start exploring our APIs

POST

https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/links

This API will shorten a long URL to a short URL, which can be used to track data. To shorten a long URL through our API, you will need to make a HTTP POST request to

Parameter
Name
Value
Description
* long_url
formData

The URL that you wish to shorten. Only valid URL’s will be shortened.

* expire_in
formData

The duration(seconds) after which the short URL becomes invalid.
Minimum is 60 seconds and default is 31 days. max. value is  365 days

* tracking
formData

Whether to track the URLs present in the SMS. Can be: “true” or “false”. “ShortenUrl” needs to be “true” for Tracking to work.

* callback_url
formData

Once someone clicks on the shortened URL,  Exotel will do a POST callback to your end point if the URL is set as a parameter in the API.  

Below are the parameters – 

sid – The Sid (unique id) of the shortened URL  

short_url – The complete shortened URL

short_code – Key of the shortened URL 

long_url – Original URL which is shortened

Tracking – Whether to track the URLs present in the SMS

custom_field – custom field passed in SMS API request String value

Expires_at –  Date Time in ISO format when link will expire

Created_time – Date Time in ISO format when URL is created

Last_viewed –  Date Time in ISO format when link was visited last

Total_clicks  – count of total views of short url

Account_sid –  Exotel’s unique Account SID

Country_code – Country code of the customer who received the SMS

Date_created – Date Time in ISO format when link was created 

Sms_sid – The Sid (unique id) of the SMS, this SID can be used to track the SMS

To –  Contact number of the customer who clicked on the URL

city – City where the shorten URL is clicked

Country – Country code where shorten URL is clicked

IP – IP address where shorten URL is clicked

Postal code – Postal code where shorten URL is clicked 

Region – Region where shorten URL is clicked

Accuracy radius – Aproximate accuracy radius where shorten URL is clicked 

OS_version – OS version of the customer who clicked the shorten URL 

OS_name – OS name of the customer who clicked the shorten URL 

Device_name – Device name of the customer who clicked the shorten URL 

Platform type – Platform where shorten URL is clicked 

* custom_field
path

Set a Custom Field relevant to your use case while sending a long URL. E.g Order ID, Payment ID, Login Attempt etc. Any content / json body upto 1024 chars

* custom_domain
path

The custom domain you can specify. Default is exo.tl 

Response Content Type

GET

https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/links/<uuid>

To get the details of a shortened URL SMS , you will need to make a HTTP GET request to

Parameter
Name
Value
Description
* uuid
formData

The Sid (unique id) of the shortened URL  

Response Content Type