Skip to content

Support for List Query Parameters in GET List Requests

Starting from version 3.3, our scripts support query parameters for GET requests. This allows you to filter, select, sort, limit and skip the results directly from the URL.

These parameters can be used with every list endpoint and with its /info counter:

  • Studio: /api/shows, /api/profiles, /api/pages, /api/playlists, /api/templates, /api/engines, /api/users, /api/userroles, /api/layouts, /api/bindings, /api/uimappings, /api/globalvariables, /api/data/feeds, /api/data/sources, /api/branding/channels, /api/userinterfaces, and /api/storage (skip, limit and filter only)
  • MediaHub: /api/assets, /api/users, /api/userroles, /api/storage, /api/jobs

They also work on the sub-lists of a show - /api/shows/[ID]/templates, /pages and /bindings - where the show filter is set for you and cannot be overridden.

GET /api/shows - list all shows

Supported Query Parameters

Parameter Description Example
filter Filters the results based on field values.
Use the format: key:value.
Multiple filters are comma-separated.
A plain value is an exact, case-sensitive match; see Filter for regular expressions, ids and operators.
filter=name:Test,path:/^STUDIO1/i
select Specifies which fields to return. Separate multiple fields with commas. select=name,enabled
sort Sorts the results by a field. Use :1 for ascending, :-1 for descending. sort=name:1
limit Limits the number of returned results. 0 means no limit. limit=1
skip Skips N results. 0 means no skip. skip=10
resolvePath When true, the path of each returned object is given as folder names instead of ids. resolvePath=true

Detailed Examples per Parameter

Filter

The key and the value are separated by a colon. An = is not a separator: filter=path=/^STUDIO1/i is read as the key path=/^STUDIO1/i with an empty value, and matches nothing.

The value is interpreted in this order:

  1. The literal undefined is parsed as no value at all for that key.
  2. A 24-hex value is converted to an ObjectId, so filter=show:5e1b0b9a8f1c2d0012a4b7c1 matches a reference.
  3. A value that is valid JSON is passed through to Mongo as-is. This is how you write an operator: filter=num:{"$gte":1000}.
  4. /pattern/flags becomes a regular expression: filter=path:/^STUDIO1/i.
  5. Anything else is an exact, case-sensitive equality.

Repeating the same key builds an array of values: filter=name:a,name:b.

Example Description
/api/shows?filter=path:/ list only shows that has the "path" /
/api/shows?filter=name:NFL_UNREAL_2023,path:/ list only shows that has the "name" NFL_UNREAL_2023 and "path" /
/api/shows?filter=name:/^NFL/i list shows whose name starts with "NFL", ignoring case
/api/pages?filter=show:5e1b0b9a8f1c2d0012a4b7c1 list the pages of one show

Select

select also accepts a JSON object, for example select={"name":1,"path":1}.

Example Description
/api/shows?select=name:1 list all shows but selects only "name" field
/api/shows?select=name list all shows but selects only "name" field
/api/shows?select=name,path list all shows but selects only "name" and "path" fields
/api/shows?select=name:0 list all shows but selects every field except "name" field

Sort

The value must be a number. A non-numeric value, such as sort=name:asc, is ignored.

Example Description
/api/shows?sort=name:1 list all shows and sort them by name ASC
/api/shows?sort=name:-1 list all shows and sort them by name DESC

Skip

Example Description
/api/shows?skip=1 list all shows but skips 1
/api/shows?skip=100 list all shows but skips 100

Limit

Example Description
/api/shows?limit=1 list all shows but with the limit (currently will return only one show because the limit is 1)

Counting instead of listing

Every list endpoint has an /info counterpart that takes the same filter and answers with the number of matching documents instead of the documents themselves.

GET /api/shows/info?filter=path:/

1
2
3
{
    "count": 12
}

Combined Examples

  • Get one show with the name TestShowName sorted by name, returning only the name field:
    GET /api/shows?filter=name:TestShowName&select=name&sort=name:1&limit=1

  • Get all shows with name TestShowName and path starting with STUDIO1, sorted by name:
    GET /api/shows?filter=name:TestShowName,path:/^STUDIO1/i&sort=name:1

  • Get only the name and enabled fields of all shows:
    GET /api/shows?select=name,enabled