Link Shortening Service#
Description#
The functionality of the service:
replacing long links in the message text with short ones;
link matching storage;
redirecting from a short link to a long one;
collecting traffic statistics.
shortenLinks
parameter, which can be sent in the request.Links are shortened for the following types of messages:
Viber;
SMS;
Push;
VK.
Service Operation#
When a long link is detected in the message, a new link is formed - the http://kr4.me/ domain is inserted at the beginning of the new link and a unique
UID
is added, which length can be from 3 to 8 characters. Example of a link after shortening: http://kr4.me/EQiCREB.After messages are delivered, when subscribers click the short link, the URL shortening service will identify the corresponding long URL and perform the redirection.
Clicks on each link will be recorded in the Platform statistics.
Service Setup#
To enable the service, the following data must be provided to the Technical Support Service:
the number of characters after which the link must be shortened. For example, if the link is shortened by more than 26 characters, then the https://rapporto.ru/ link will be transmitted to the subscriber unchanged, and the https://rapporto.ru/company/o_platforme_rapporto/ link will be shortened, for example http://kr4.me/QEiCRE/;
the number of characters in the
UID
that is added after the domain. This parameter affects the number of unique links that can be generated. For example, with a length of UID = 8 characters, about 281 trillion unique links can be generated;clarify the need to generate unique links for each subscriber. This parameter affects the traffic statistics. If a single link is used for all subscribers, the total traffic statistics for all subscribers will be displayed;
the number of days after which an inactive link is deleted if there were no clicks on it;
the link lifetime – the number of days after which an inactive link is deleted, even if there were clicks on it.
TLV Parameters for Link Shortening#
Two different parameters are used to shorten links in message texts:
shorten_links
– for shortening links in the text of individual messages;shorten_list
– for shortening links in the texts of messages within the cascade message.
Shortening links in the text of individual messages.
TLV Parameter |
Field |
Octets size |
Type |
Description |
---|---|---|---|---|
shorten_links |
Tag |
2 |
Integer |
id = 0x4001 |
Length |
2 |
Integer |
Length of the parameter in octets. |
|
Value |
1 |
Octet String |
Shortening links in the text of the message. The byte representation of the |
Shortening links in the texts of messages within a cascade message.
shorten_list |
Tag |
2 |
Integer |
id = 0x4002 |
Length |
2 |
Integer |
Length of the parameter in octets. |
|
Value |
up to 1000 |
Octet String |
Shortening links in the cascade message. The parameter value must contain a list of message types
(comma-separated) for which link shortening is required.
Possible message type values (case insensitive):
For example, “V,S” means that URLs should be shortened in VK and SMS messages, but not in Viber messages. If URL shortening is enabled for the Partner, the following scenarios are possible:
|