Counting your links

Your branded short links collection size can be read with a HTTP GET on the count links endpoint https://api.rebrandly.com/v1/links/count.

If you want to get the number of branded short links matching a given set of conditions (e.g. answering how many branded short links have been created with the domain brand.cool?), you can attach filters to your request:

QUERY PARAMETERS

Parameter nameTypeConstraintsDescription
favouritebooleanoptionalFilter branded short links depnding on the favourite (loved) property
domain.idstringoptionalFilter branded short links which refer to a specific branded domain id
GETting filtered links collection size
$ curl 'https://api.rebrandly.com/v1/links/count?favourite=false&status=active&domain.id=8f104cc5b6ee4a4ba7897b06ac2ddcfb' \
-H 'apikey: YOUR_API_KEY'
A numeric value is provided back:
{
    "count": 42
}

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.
404404 - Not found
with property value "domain.id"
Given domain.id does not correspond to any existing domain