URL Shortening over API
URL Shortening and Tracking is currently available over API on SMS and Viber.
On SMS, URL Shortening and Tracking is supported on the HTTP API and SMPP. For more information on SMPP, see SMPP Specification.
You can enable shortening and tracking in the API request to Infobip using the following:
json
{
...
"urlOptions": {
"shortenUrl": true,
"trackClicks": true,
"trackingUrl": "https://mybrand.com/track-url-clicks-webhook",
"removeProtocol": true,
"customDomain": "mybrand.com"
}
}
Where:
Option | Description |
---|---|
shortenUrl | Default: true. Can only be "true" if using urlOptions |
trackClicks | Set to either "true" or "false" to track when an end user clicks a URL. Default: true. Note, can only be used for Shortened URLs. |
trackingUrl | The webhook to which you want the URL click events to be returned. |
removeProtocol | Set to "true" or "false" for remove the "https://" from the URL. Default: false |
customDomain | The custom or brand domain that you want to keep. |
In addition, take note of the following guidance:
- If you submit an invalid custom domain in the SMS request, the message fails and a delivery report indicates the rejection.
- If customDomain is not set, the URL will be shortened using an Infobip default domain.