Links has the ability to add a GET type HTTP service to receive click notifications in real time.

<aside> ⚠️ This functionality is not available for URLs that are generated through integration with other products, in those cases, the information will be reported directly to the webhooks of those products.

</aside>

How to add a Webhook?

For the generation of links via API, there is a property included in the request, in the endpoint signature there is a field called ‘webhook’, this accepts a list of webhooks to which you want Links to report the click events of your URL.

<aside> 💡 Links will take between 3 to 5 minutes to report the click events to your webhook(s) after the click.

</aside>

Below is an example of the signature in JSON format of the URL generation from the Shorter endpoint of Links, the underlined webHooks property of type text string should indicate the complete URL of the webhook type service where the respective clicks will be received. If you have doubts about how to make the request, check the following link:

POST Shorter

{
    "idClient": 00001,
    "idCampaign": 1,
    "IdProduct": "masivlinks",
    "customDomain": "<https://links.ma.sv/>",
    "UrlDueDate": "",
    "UrlActiveDate": "2023-07-28 11:24:20",
    "UrlType": 0,
    "idDelivery": "1234567890",
    "webHooks": ["<https://webhookUrlExample.web.hook/>"],
    "UrlRequest": [
        {
            "name": "Test ",
            "url": "<https://www.google.com/>",
            "preview": {
                "Title": "Test",
                "Description": "Test",
                "KeyImage": ""
            }
        }
    ]
}

Example of Webhook Notification

The English translation of your text is: “The signature of the HTTP service type webhook should be as follows, a fully descriptive example of each of the data shared in the service is shared.

{
  "EventType": "UserClick",
  "EventBody": {
    "Metadata": {},
    "Segment": "Q7tAxat",
    "IdClient": "00001",
    "IdCampaign": "20230824141025935",
    "IdProduct": "masivlinks",
    "IdDelivery": "20230824141025935",
    "Recipient": "[email protected]",
    "CreationDate": "2023-08-24",
    "ActiveDate": "2023-08-24",
    "UrlDomain": "<https://links.ma.sv>",
    "TargetUrl": "<https://www.google.com/>",
    "ClickAccessDate": "2023-08-24 14:12:01",
    "UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.54",
    "BrowserName": "Microsoft Edge",
    "DeviceVendor": "Samsung",
    "DeviceType": "Cellular",
    "OsName": "Android",
    "IpRemote": "::ffff:186.29.181.118",
    "ConnectionType": "Cellular",
    "CountryName": "Colombia",
    "IspName": "Claro",
    "OrganizationName": "Claro"
  }
}