Get a List of Resources

Offers the ability to return lists of resources for your site, looked up by a query if desired.

Sort Specification

The data.sort option must be in the form of an allowed field name:

FieldDescription
bt_updated_atSort by the time Boomtrain last checked on this resource, most recently to least recently.
recencySort by the date field that is specified as your site's "recency" field, typically pubDate. You may contact your Zeta Solutions Manager to adjust your recency field to a different field.
bt_statistics.viewed.cumulative.P7DSort by the number of views in the last 7 days, most to least.
bt_statistics.viewed.cumulative.P1DSort by the number of views in the last 1 day, most to least.
fieldSort by a specified currency, numerical or timestamp resource field. When field is specified, he request should also include two additional fields, sort_order and field_name as documented below.
field_nameSpecifies the numerical or timestamp resource field to sort by when data.sort = field. Must be a resource field that is a date, currency, or numerical value.
sort_orderSpecifies the sort order of the resources returned when data.sort = field. Must be either asc (ascending order from smallest/least recent to largest/most recent) or desc (descending order from largest/most recent to smallest/least recent). Default for unspecified sort order is asc.

Query Specification

The value of data.query, if specified, determines the set of resources returned by this route. data.query should be a list of search criteria objects, each with the following format:

field - A string that indicates which field of the resource the criteria will be applied to, e.g. "resource_type", "published_at", "title". Note that currently fields in the "props" object of resources are not queryable.
operator - The operator for the criteria. Search operators allow you to specify relations between the criteria values. Supported operators are listed below.
values - An array of values representing the values of the specified field to filter the search to.

If more than one search criteria object is used, the result will be interpreted as the intersection of the criteria, i.e. criteria1 ∩ criteria2 ∩... For example, adding the following criteria:

{"name":"resource_type", "operator":"=", "values": ["article"]}, {"name":"is_blacklisted", "operator":"=", "values": [true]}

would restrict the result set to articles with that are blacklisted.

Supported Operators

FieldValues AcceptedFunctionExample
=String, Boolean, ISO Timestamp, NumberReturns resources where the field specified in name matches the provided value. If the field is an array, returns resources where the specified field contains at least one of the elements of values.{"name":"title", "operator":"=", "values":["Foo", "Bar"]} // returns resources that contain "Foo" or "Bar" as a title.

{"name":"is_blacklisted", "operator":"=", "values":[true]} // returns resources that have the is_blacklisted field set to true.
NOTString, Boolean, ISO Timestamp, NumberReturns resources where the field specified in name does not match the provided value. If the field is an array, returns resources where the specified field contains none of the elements of values.{"name":"title", "operator":"NOT", "values":["Foo", "Bar"]} // returns resources that do not have "Foo" or "Bar" as a title.

{"name":"is_blacklisted", "operator":"NOT", "values":[true]} // returns resources that have the is_blacklisted field set not to true.
BEFOREA single ISO-8601 Duration TimestampReturns resources where the field specified in name, which must be a timestamp-based field, is before the timestamp value provided relative to the current time.{"name":"pubDate", "operator":"AFTER", "values":["-P1D"]} // returns resources that have a pubDate after 1 day ago.
AFTERA single ISO-8601 Duration TimestampReturns resources where the field specified in name, which must be a timestamp-based field, is after the timestamp value provided relative to the current time.{"name":"event_start_date", "operator":"AFTER", "values":["P1D"]} // returns resources that have an event_start_date more than 1 day in the future.
BETWEENAn array of two ISO-8601 Duration TimestampsReturns resources where the field specified in name, which must be a timestamp-based field, is between the timestamp values provided relative to the current time. The first value should indicate a timestamp that is before the second value relative to now.{"name":"event_start_date", "operator":"BETWEEN", "values":["P1D', "P7D"]} // returns resources that have an event_start_date between 1 and 7 days in the future.
Language
Authorization
Header
Click Try It! to start a request and see the response here!