Library API

Pagination

In requests that can respond with potentially large collections, such as the collection returned by https://video.qbrick.com/api/v1/accounts/{accountId}/medias?limit=30&offset=60, the results will be paginated to 200 items by default. You can use the offset parameter to specify which collection of data to retrieve. You can use limit parameter to set custom collection sizes on the API responses. API responses return pre-built pagination links with rels first, prev, next and last and client applications are encouraged to follow these links for pagination.

Sorting

Paginated results can be sorted according to one of more criteria using the sort param. Clients can specify sort criteria as a comma-separated list of the names of fields that should be used to sort. The default sort order is ascending. https://video.qbrick.com/api/v1/accounts/{accountId}/medias?sort=relevance+desc

Partial response

To request a partial response, use the fields request parameter to specify the fields you want returned. You can use this parameter with any request that returns a response body. The format of the fields request parameter value is loosely based on XPath syntax.

https://video.qbrick.com/api/v1/accounts/{accountId}/medias?fields=*(asset/resources/*/renditions/*/links)

The supported syntax is summarized below.

Search queries

You can easily search for any information in the Library. All GET requests allows a q parameter where you specify your search criteria.

These criteria and filters can be combined to perform complex queries.

https://video.qbrick.com/api/v1/accounts/{accountId}/medias?q=*alice* bob created:[2020-03-01 TO 2020-04-01] id:*234* !catalog.id:* metadata.description:s* !asset.resources.type:subtitle asset.resources.type:video

For example, the above request will return all media that:

The following section lists the currently allowed values for a search query:

QueryShort notationDescription
Termsq=aliceExact term anywhere
q=alice OR bobq=alice bobEither term anywhere
q=\"alice bob\"Exact phrase anywhere
Fieldsq=metadata.title:aliceExact term in the field
q=metadata.title:\"alice bob\"Exact phrase in the field
q=catalog:id:*Contained in a catalog
Wildcardsq=ali*Starting with, anywhere
q=al?ceOne character wildcard
q=metadata.title:*alice*Anywhere in terms in the field
Rangesq=created:[2019-01-01 TO 2020-01-01]Creation date window
q=updated:{2019-01-01 TO 2020-01-01}Exclusive update date window
q=created:[2019-01-01 TO ]Created after
q=updated:[ TO 2019-01-01]Updated before
Boostq=metadata.title:alice^2Only applied when sorting by relevance, boosted fields will appear first in the results
q=metadata.title:\"alice bob\"^2
Booleansq=metadata.title:alice OR metadata.title:bobq=metadata.title:alice || metadata.title:bobOR is the default operator for search terms and can be omitted
q=metadata.title:alice AND metadata.title:aliceq=metadata.title:alice && metadata.title:aliceAND is the default operator for filters and can be omitted
q=metadata.title:alice OR metadata.title:bob AND metadata.title:carolq=metadata.title:alice || metadata.title:bob && metadata.title:carolComplex query with booleans, not recommended
q=alice OR bob AND id:234q=alice bob id:234'alice' and 'bob' are search criteria, 'id:' is a filter ; AND and OR can be omitted since they are default operators
Restrictionsq=NOT metadata.title:aliceq=!metadata.title:aliceExact restricted term in a field
q=NOT catalog.id:*q=!catalog.id:*Not cataloged
Groupsq=(metadata.title:alice OR metadata.title:bob) AND metadata.title:carolExplicit operator hierarchy
q=metadata.title:(alice OR bob AND carol)Grouped values on the same field