URL Shortener API \ Read the details of an URL PHP SDK

Resource/URI GET POST PUT DELETE
Shortened URLs /shorturls.json List all shortened URLs Shorten
an URL
Shortened URL /shorturls/<shorturl_token>.json Retrieve URL details Delete shortened URL

Workflow

Request: the code to send to the API

Send a GET request to the resource /shorturls/<shorturl_token>.json to retrieve the details of the clicks on a shortened URL.

Result: the code returned by the API

The API will return the click-through details of the shortened url, including the IP address, user agent and demographic information if available. Requests that return multiple entries will be paginated to the last 50 clicks by default.

Example Resultset

{
  "response": {
    "request": {
      "date": "Thu, 21 Mar 2019 18:19:54 +0100",
      "resource": "/shorturls/Dpkuo.json?page=1&entries_per_page=1",
      "status": {
        "flag": "success",
        "code": 200,
        "info": "Your request has been processed successfully"
      }
    },
    "result": {
      "data": {
        "shorturl": {
          "shorturl_token": "Dpkuo",
          "original_url": "http://www.oneall.loc/services/user-engagement-solutions/url-shortener/",
          "short_url": "http://oal.lu/Dpkuo",
          "date_creation": "Thu, 15 Sep 2011 11:00:56 +0200",
          "date_last_referral": "Thu, 21 Mar 2019 17:15:12 +0100",
          "num_referrals": 3,
          "referrals": {
            "pagination": {
              "current_page": 1,
              "total_pages": 3,
              "entries_per_page": 1,
              "total_entries": 3,
              "order": {
                "field": "date_creation",
                "direction": "asc"
              }
            },
            "count": 1,
            "entries": [
              {
                "page": "http://www.example-referrer.com/",
                "date_creation": "Thu, 21 Mar 2019 16:39:08 +0100",
                "ip_address": "17.45.170.114",
                "user_agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0",
                "country": {
                  "short": "Chile"
                  "long": "Republic of Chile"
                  "iso_alpha2": "CL"
                }
              }
            ]
          }
        }
      }
    }
  }
}

User Contributed Notes