URL Shortening

We support URL shortening for both SMS and SMS Campaign, making it easier to craft a more digestible message for your recipients and also allowing you to save characters in your messages.

Some limitations to be aware of are:

  • Only valid links are processed. A valid URL must include a proper protocol (e.g., http:// or https://) or a valid domain (e.g., example.com).
    • https://example.com
    • example.com
    • www.example.com
  • We can shorten links up to 250 characters in length.

SMS

For SMS messages, URL shortening automatically detects and replaces one URL in each message with a shortened link in the format smsu.io/xxxxxx. The xxxxxx placeholder represents a unique six-character alphanumeric string that is generated for each recipient during the actual sending process.

You should use this endpoint if you wish to send out a link that is specific to the recipient, such as order tracking links, or customised feedback forms.

To use short URLs on SMS sending, refer here.

SMS Campaign

We support URL shortening and subsequent link tracking within SMS campaigns.

When using the short URL functionality in SMS Campaign, all recipients will receive a shortened link in the format smsu.io/xxxxx. The xxxxx placeholder represents a unique five-character alphanumeric string that is generated for each recipient during the actual sending process.

You should use this endpoint if you're sending out the same link to many recipients and wish to track its engagement such as whether the link was opened.

To use short URLs when sending an SMS campaign, refer here.

Languages
Servers
https://rest.clicksend.com/

Get Statistics

Request

Use this endpoint to get the aggregated statistics for a shortened URL. This allows you to track the total number of clicks on the link. You can gather details such as the device type and where it was opened from as well.

Path
sourcestringrequired

Source of the request.

Value"quick_sms"
source_idstringrequired

ID of the source (e.g. message ID).

Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/short-url/statistics/{source}/{source_id}'

Responses

Successful response

Bodyapplication/json
dataArray of objects
Response
application/json
{ "data": [ {} ] }

Get Tracking

Request

Use this endpoint to track how individual recipients interact with the link. It returns data from the most recent click, including statistics such as how many times they’ve visited the link and when it was last opened. To use this endpoint, reference the long_url_id provided in the GET /short-url/statistics endpoint.

Path
long_url_idstringrequired

ID of the long URL (uniquely defined by the source, source ID, and long URL). Obtained from the GET statistics endpoint.

Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/short-url/tracking/{long_url_id}'

Responses

Successful response

Bodyapplication/json
totalnumber

Total number of short URLs associated with the long URL ID

Example: 500
per_pagenumber<= 100

The limit of tracking data per page

Example: 20
current_page_sizenumber<= 100

The number of data in the current page

Example: 1
prev_page_urlstring

Link to the previous page. This attribute will not be present if there is no previous page.

Example: "https://rest.clicksend.com/v3/short-url/tracking/quick_sms-4961a11d-45bb-4d34-9d23-98dc9b277c38-123456-caee6179deb28e135538cb74e2eca2bd?offset=eyJsb25nX3VybF9pZCI6InNtc19jYW1wYWlnbi00OTYxYTExZC00NWJiLTRkMzQtOWQyMy05OGRjOWIyNzdjMzgtMTIzNDU2LWNhZWU2MTc5ZGViMjhlMTM1NTM4Y2I3NGUyZWNhMmJkIiwic2hvcnRfdXJsIjoic21zdS5pby9EdXBOR1YifQ&limit=100&direction=backward"
next_page_urlstring

Link to the next page. This attribute will not be present if there is no next page.

Example: "https://rest.clicksend.com/v3/short-url/tracking/quick_sms-4961a11d-45bb-4d34-9d23-98dc9b277c38-123456-caee6179deb28e135538cb74e2eca2bd?offset=eyJsb25nX3VybF9pZCI6InNtc19jYW1wYWlnbi00OTYxYTExZC00NWJiLTRkMzQtOWQyMy05OGRjOWIyNzdjMzgtMTIzNDU2LWNhZWU2MTc5ZGViMjhlMTM1NTM4Y2I3NGUyZWNhMmJkIiwic2hvcnRfdXJsIjoic21zdS5pby9ROFVOdEcifQ&limit=100&direction=forward"
dataArray of objects

Tracking data of the short URLs associated with the specified long URL ID. Note that only the data from the most recent click of the recipient (country, region, device, browser, and os) is recorded.

Response
application/json
{ "total": 500, "per_page": 20, "current_page_size": 1, "prev_page_url": "https://rest.clicksend.com/v3/short-url/tracking/quick_sms-4961a11d-45bb-4d34-9d23-98dc9b277c38-123456-caee6179deb28e135538cb74e2eca2bd?offset=eyJsb25nX3VybF9pZCI6InNtc19jYW1wYWlnbi00OTYxYTExZC00NWJiLTRkMzQtOWQyMy05OGRjOWIyNzdjMzgtMTIzNDU2LWNhZWU2MTc5ZGViMjhlMTM1NTM4Y2I3NGUyZWNhMmJkIiwic2hvcnRfdXJsIjoic21zdS5pby9EdXBOR1YifQ&limit=100&direction=backward", "next_page_url": "https://rest.clicksend.com/v3/short-url/tracking/quick_sms-4961a11d-45bb-4d34-9d23-98dc9b277c38-123456-caee6179deb28e135538cb74e2eca2bd?offset=eyJsb25nX3VybF9pZCI6InNtc19jYW1wYWlnbi00OTYxYTExZC00NWJiLTRkMzQtOWQyMy05OGRjOWIyNzdjMzgtMTIzNDU2LWNhZWU2MTc5ZGViMjhlMTM1NTM4Y2I3NGUyZWNhMmJkIiwic2hvcnRfdXJsIjoic21zdS5pby9ROFVOdEcifQ&limit=100&direction=forward", "data": [ {} ] }