Skip to content

URLs Calls

Introduction

The toplinkclicked API resource help you identify from where links in your emails are clicked.

In addition to that, our API offers a full range of statistics related methods to help you extract meaningful data about your email. Please refer to our dedicated guide to learn more.

List

Info

Maps to /urls/list.json

<?php
require 'vendor/autoload.php';
use \Mailjet\Resources;
$mj = new \Mailjet\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'));
$response = $mj->get(Resources::$Toplinkclicked);
$response->success() && var_dump($response->getData());
?>
{
  "Count": 1,
  "Data": [
    {
      "ClickedCount": "3",
      "ID": "-1",
      "LinkId": "1",
      "Url": "www.example.com"
    }
  ],
  "Total": 1
}

Issue a GET request to toplinkclicked.

Info

Maps to /urls/search.json

<?php
require 'vendor/autoload.php';
use \Mailjet\Resources;
$mj = new \Mailjet\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'));
$filters = [
  'FromDomain' => 'example.com'
];
$response = $mj->get(Resources::$Toplinkclicked, ['filters' => $filters]);
$response->success() && var_dump($response->getData());
?>
{
  "Count": 1,
  "Data": [
    {
      "ClickedCount": "3",
      "ID": "-1",
      "LinkId": "1",
      "Url": "www.example.com"
    }
  ],
  "Total": 1
}

Issue a GET request to toplinkclicked using the FromDomain query filter, to filter the dataset on the domain you're looking for.

Time-Series

Info

Maps to /urls/time-series.json

<?php
require 'vendor/autoload.php';
use \Mailjet\Resources;
$mj = new \Mailjet\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'));
$filters = [
  'FromTs' => '1456479862',
  'ToTs' => '1458985462'
];
$response = $mj->get(Resources::$Toplinkclicked, ['filters' => $filters]);
$response->success() && var_dump($response->getData());
?>
{
  "Count": 1,
  "Data": [
    {
      "ClickedCount": "3",
      "ID": "-1",
      "LinkId": "1",
      "Url": "www.1456479862"
    }
  ],
  "Total": 1
}
{
  "Count": 1,
  "Data": [
    {
      "ClickedCount": "3",
      "ID": "-1",
      "LinkId": "1",
      "Url": "www.example.com"
    }
  ],
  "Total": 1
}

Issue a GET request to toplinkclicked using the FromTs and ToTs query filters, to filter the dataset within your date range. These filters expect UNIX epoch timestamps.