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 name | Type | Constraints | Description |
---|---|---|---|
orderBy | string enum - createdAt _default_See Sorting | optional | Sorting criteria to apply to your branded short links collection |
orderDir | string enum - desc default - asc See Sorting | optional | Sorting direction to apply to your branded short links collection |
last | string See Pagination | optional | The id of the last link you fetched in the last listing API call |
limit | integer default is 25 See Pagination | optional Strictly positive Max 25 | How many branded short links to load |
favourite | boolean | optional | Filter branded short links depending on favourite (loved) property |
domain.id | string | optional | Filter branded short links which refer to a specific branded domain id (or specify a comma-separated set of ids) |
domain.fullName | string | optional | Filter branded short links which refer to a specific branded domain's name (FQDN) |
creator.id | string | optional | Filter branded short links which have been created by a specific teammate id (or specify a comma-separated set of ids) |
slashtag | string | optional (when specified, it is mandatory to specify also domain.id or domain.fullName ) | Filter branded short links according to their slashtag |
dateFrom | string | optional | Filter 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 |
dateTo | string | optional | Filter 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 Status | Error type | Description |
---|---|---|
403 | 403 - Invalid format | Invalid query parameters format. Double check value for property query parameter. Details about validation failure in message field |
Updated 7 months ago