Listing your scripts

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

🚧

Beware the script value

When you load a single script via API, we return the script content along with the API response. By contrast, when you ask for your scripts' list via API, we only reference the public URI where you can download the script's content.

📘

Understanding pagination and sortings

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

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

QUERY PARAMETERS

Parameter nameTypeConstraintsDescription
orderBystring enum

- name
_default_See Sorting
optionalSorting criteria to apply to your scripts collection
orderDirstring enum

- desc
default
- ascSee Sorting
optionalSorting direction to apply to your scripts collection
laststring

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

See Pagination
optional
Strictly positive
Max 25
How many scripts to load
GETting scripts collection
$ curl 'https://api.rebrandly.com/v1/scripts ?orderBy=name&orderDir=asc&limit=100' \
-H 'apikey: YOUR_API_KEY'
JSON response (list of scripts matching filters)
[
 {
  "id": "fffa4cc5b6ee45d6g7897b06ac2d16af",
  "name": "Alert1",
  "uri": "https://s3.amazonaws.com/rb-scripts/user/fffa4cc5b6ee45d6g7897b06ac2d16af"
 },
 {
  "id": "abcdecc5b6ee45d6g7897b06ac2d1xyz",
  "name": "Alert2",
  "uri": "https://s3.amazonaws.com/rb-scripts/user/abcdecc5b6ee45d6g7897b06ac2d1xyz"
 }
 // up to 100 scripts objects sorted by name
]

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