You can use Exotel's SMS API to shorten a long URL in SMS and you can track customer's click data as well. Shortening a long URL will also reduce the number of characters in SMS and allow you to stick to the 160 characters limit for SMS. Follow steps below to set it up:


1. Get in touch with your Account Manager or drop an email to "hello@exotel.com" to enable URL shortening services for your account 


2. While making the API Request to send SMS, make below changes to your SMS request -

  1. Set Parameter "ShortenUrl" -  'true' if you want to shorten a URL, To provide flexibility, we allow you to set it to 'false' as well don't want to shorten any particular SMS.

  2. Set Parameter "ShortenUrlParams[CustomDomain] " - with the custom domain you want the short URL to start with. If custom domain is not present or empty, we will use the default domain(exo.tl), If custom domain is given in the request it will be used to form the short URL . Note : Clients will have to route the traffic on their custom domain to exo.tl domain, this is a change on your domain management system

  3. Set Parameter "ShortenUrlParams[Tracking] " - 'true' if you want to track data when a customer clicks on the URL. This feature is currently available to select customers. 

  4. In Parameter "ShortenUrlParams[ClickTrackingCallbackUrl]” - enter a valid URL to receive click tracking data 

You can also use sample requests available on our developer portal to use the feature and use the sample collection from Postman. 




3 . Below would be the API response , SMS will be delivered with a short URL . eg - https://exo.tl/vhdpzv . The Short URL has a validity of 1 month. 




4. Whenever someone clicks on the shortened URL, the following data would appear in the URL provided in "ShortenUrlParams[ClickTrackingCallbackUrl] -


  1. Sid - The Sid (unique id) of the shortened URL
  2. Short_url - The complete shortened URL
  3. Short_code - Key of the shortened URL
  4. Long_url - Original URL which is shortened
  5. Tracking - Whether the URL is being tracked or not
  6. Custom_field - custom field passed in SMS API request 
  7. Expires_at -  Date Time in ISO format when link will expire 
  8. Created_time - Date Time in ISO format when URL is created 
  9. Last_viewed -  Date Time in ISO format when link was visited last
  10. Total_clicks  - count of total views of short url
  11. Account_sid -  Exotel’s unique Account SID
  12. Country_code - Country code of the customer who received the SMS 
  13. Date_created - Date Time in ISO format when link was created 
  14. Sms_sid - The Sid (unique id) of the SMS, this SID can be used to track the SMS
  15. To -  Contact number of the customer who clicked on the URL 
  16. city - City where the shorten URL is clicked
  17. Country - Country code where shorten URL is clicked
  18. IP - IP address where shorten URL is clicked
  19. Postal_code - Postal code where shorten URL is clicked 
  20. Region - Region where shorten URL is clicked
  21. Accuracy_radius - Aproximate accuracy radius where shorten URL is clicked 
  22. OS_version - OS version of the customer who clicked the shorten URL 
  23. OS_name - OS name of the customer who clicked the shorten URL 
  24. Device_name - Device name of the customer who clicked the shorten URL                                 
  25. Platform_type - Platform where shorten URL is clicked


If you have any questions or concerns, please connect with us using the chat widget on your Exotel Dashboard or Whatsapp us on 08088919888