Listing your links

You can access your branded short links collection at any time with an HTTP GET on the links endpoint https://api.rebrandly.com/v1/links.

📘

Understanding pagination and sortings

We recommend you have deep comprehension about how our API manages Pagination and Sorting.

If you want to get only branded short links matching a given set of conditions, you can attach filters to your request:

QUERY PARAMETERS

Parameter nameTypeConstraintsDescription
orderBystring enum

- createdAt
_default_See Sorting
optionalSorting criteria to apply to your branded short links collection
orderDirstring enum

- desc
default
- ascSee Sorting
optionalSorting direction to apply to your branded short links collection
laststring

See Pagination
optionalThe id of the last link you fetched in the last listing API call
limitinteger
default is 25

See Pagination
optional
Strictly positive
Max 25
How many branded short links to load
favouritebooleanoptionalFilter branded short links depending on favourite (loved) property
domain.idstringoptionalFilter branded short links which refer to a specific branded domain id (or specify a comma-separated set of ids)
domain.fullNamestringoptionalFilter branded short links which refer to a specific branded domain's name (FQDN)
creator.idstringoptionalFilter branded short links which have been created by a specific teammate id (or specify a comma-separated set of ids)
slashtagstringoptional
(when specified, it is mandatory to specify also domain.id or domain.fullName)
Filter branded short links according to their slashtag
dateFromstringoptionalFilter branded short links according to the date they have been created, so as to exclude links created before this date

Format is YYYY-MM-DD
dateTostringoptionalFilter branded short links according to the date they have been created, so as to exclude links created after this date

Format is YYYY-MM-DD
GETting links collection
$ curl 'https://api.rebrandly.com/v1/links?orderBy=createdAt&orderDir=desc&limit=100&favourite=false&status=active&domain[id]=8f104cc5b6ee4a4ba7897b06ac2ddcfb' \
-H 'apikey: YOUR_API_KEY'
JSON response (list of links matching filters)
[
 {
  "id": "fffa4cc5b6ee45d6g7897b06ac2d16af",
  "title": "What is Rebrandly?",
  "slashtag": "video",
  "destination": "https://www.youtube.com/watch?v=3VmtibKpmXI",
  "createdAt": "2016-07-13T10:54:12.000Z",
  "updatedAt": "2016-07-15T10:05:22.000Z",
  "shortUrl": "rebrand.ly/video",
  "favourite": false,
   "domain": {
    "id": "8f104cc5b6ee4a4ba7897b06ac2ddcfb",
    "ref": "/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb",
    "fullName": "rebrand.ly"
  }
},
{
  "id": "abcdecc5b6ee45d6g7897b06ac2d1xyz",
  "title": "Trending now movies",
  "slashtag": "MoviesTr3nd",
  "destination": "http://www.the-numbers.com/movies/trending",
  "createdAt": "2016-07-12T10:54:12.000Z",
  "updatedAt": "2016-07-17T10:05:22.000Z",
  "shortUrl": "rebrand.ly/MoviesTr3nd",
  "favourite": false,
  "domain": {
    "id": "8f104cc5b6ee4a4ba7897b06ac2ddcfb",
    "ref": "/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb"
  }
 },
 // up to 100 non-favourite Link objects created with domain rebrand.ly
]

Handling errors

HTTP StatusError typeDescription
403403 - Invalid formatInvalid query parameters format. Double check value for property query parameter. Details about validation failure in message field