{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/resources/:site_id","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -X POST -H 'Content-Type:application/json' -H 'Authorization: Bearer <JWT>' \n-d '{\"data\": {\"query\": [{\"name\":\"resource_type\", \"operator\":\"=\", \"values\": [\"article\"]},\n{\"name\":\"is_blacklisted\", \"operator\":\"=\", \"values\": [true]}], \"sort\":\"bt_updated_at\", \"count\":5}}'\n'https://resources.api.boomtrain.com/resources/your-site'\n","name":"Get Resources by Query"},{"name":"Get Resources from highest to lowest price","language":"curl","code":"curl -X POST -H 'Content-Type:application/json' -H 'Authorization: Bearer <JWT>' \n-d '{\"data\": {\"query\": [], \"sort\":\"field\", \"sort_order\":\"desc\", \"field_name\":\"price\", \"count\":5}}'\n'https://resources.api.boomtrain.com/resources/your-site'"}]},"method":"post","params":[{"name":"site_id","type":"string","default":"","desc":"The unique identifier for your Boomtrain site.","required":true,"in":"path","ref":"","_id":"572a787cd10a200e00b1cbd4"},{"name":"data.count","type":"int","default":"10","desc":"Determines the number of results to return. Maximum is 100.","required":false,"in":"body","ref":"","_id":"5774727b5b96cf0e00558e6b"},{"name":"data.sort","type":"string","default":"bt_updated_at","desc":"Specifies a resource field to sort the result set by. Default is `bt_updated_at`, or sorted from most to least recently modified. See Sort Specification below for more details.","required":false,"in":"body","ref":"","_id":"5774727b5b96cf0e00558e69"},{"name":"data.query","type":"array_object","default":"","desc":"Array representing a list of search criteria. See Query Specification below for details.","required":false,"in":"body","ref":"","_id":"5774727b5b96cf0e00558e68"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"data\": [\n    {\n    \"resource_id\":\"c182c299a664e80a9d5b5f381a8d5c53\",\n    \"resource_type\": \"article\",\n    \"thumbnail\": \"https://marketingreads.com/wp-content/uploads/2016/01/chiefmarketingtechnologist.jpeg\",\n    \"published_at\": \"2016-03-04T00:08:08.362Z\",\n    \"url\":\"https://marketingreads.com/the-chief-marketing-technologist-luxury-or-necessity/\",\n    \"description\":\"Three years ago, Gartner made headlines projecting that the CMO would outspend the CIO on technology by 2017. So far there has been little reason to doubt that bold prediction will come to pass.\",\n    \"title\":\"The Chief Marketing Technologist: Luxury or Necessity?\",\n    \"body\":\"Three years ago, Gartner made headlines projecting that the CMO would outspend the CIO on technology by 2017. So far there has been little reason to doubt that bold prediction will come to pass. More recently, CEOs have said that digital marketing will be their biggest technology-enabled business investment over the next five years, according to a 2014 Gartner survey, and marketing IT budgets continue to climb even as other marketing spending stays flat. “Marketing as an enterprise function has been taking a leading role in the implementation of new technologies that help customers connect with businesses,” said Adam Howatson, CMO of enterprise information management provider OpenText, in an interview with CMO.com. “I think it is safe to say that CMOs who ignore technology won’t be CMOs for much longer. Marketing technology will be a defining factor in how an enterprise communicates with its customers.” [Read More]  Automation , agencies, budgeting, CMO, company culture, digital marketing, hiring, marketing technology\",\n   \"props\":\n    {\n      \"language\":\"en_US\",\n      \"keywords\":[\"marketing\",\"marketers\",\"automation\",\"agencies\",\"budgeting\",\"cmo\",\"company culture\",\"digital marketing\",\"hiring\",\"marketing technology\"],\n    },\n    \"bt_updated_at\": \"2016-03-04T00:08:08.362000\"\n    },\n    {\n    \"resource_id\":\"12345\",\n    \"resource_type\": \"article\",\n    \"thumbnail\": \"https://marketingreads.com/wp-content/uploads/2016/02.jpeg\",\n    \"published_at\": \"2016-03-12T00:04:16.499Z\",\n    \"url\":\"https://marketingreads.com/the-five-headline-types-every-marketer/\",\n    \"description\":\"From listicles to rhetorical questions, here's a rundown of the best ways to capture user attention.\",\n    \"title\":\"The Five Headline Types Every Marketer Should Use\",\n    \"body\":\"Quisque cursus, metus vitae pharetra auctor, sem massa mattis sem, at interdum magna augue eget diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Morbi lacinia molestie dui. Praesent blandit dolor. \",\n   \"props\":\n    {\n      \"language\":\"en_US\",\n      \"keywords\":[\"headlines\", \"marketing\",\"marketers\",\"automation\",\"cmo\",\"digital marketing\",\"marketing technology\",\"performance\"],\n    },\n    \"bt_updated_at\": \"2016-03-22T00:14:36.245Z\"\n    }\n  ]\n}","name":"OK"},{"status":400,"language":"json","code":"{\n  'errors': [\n    {\n    \t'message': 'The request was malformed and it is unable to be processed. Please review and try again.'\n  \t}\n  ]\n}","name":""},{"status":403,"language":"json","code":"{\n  \"errors\": [\n    {\n      \"message\": \"<message>\"\n    }\n  ]\n}"},{"language":"json","status":404,"code":"{\n  \"errors\": [\n    {\n      \"message\": \"The requested resource could not be found\"\n    }\n  ]\n}"}]},"settings":"57432f2eeed4ab0e00edc652"},"next":{"description":"","pages":[]},"title":"Get a List of Resources","type":"endpoint","slug":"get-list-resources","excerpt":"Offers the ability to return lists of resources for your site, looked up by a query if desired.","body":"[block:api-header]\n{\n  \"title\": \"Sort Specification\"\n}\n[/block]\nThe `data.sort` option must be in the form of an allowed field name:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"0-0\": \"`bt_updated_at`\",\n    \"2-0\": \"`bt_statistics.viewed.cumulative.P7D`\",\n    \"3-0\": \"`bt_statistics.viewed.cumulative.P1D`\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Sort by the time Boomtrain last checked on this resource, most recently to least recently.\",\n    \"2-1\": \"Sort by the number of views in the last 7 days, most to least.\",\n    \"3-1\": \"Sort by the number of views in the last 1 day, most to least.\",\n    \"1-0\": \"`recency`\",\n    \"1-1\": \"Sort 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.\",\n    \"4-0\": \"`field`\",\n    \"4-1\": \"Sort 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.\",\n    \"5-0\": \"`field_name`\",\n    \"5-1\": \"Specifies 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.\",\n    \"6-0\": \"`sort_order`\",\n    \"6-1\": \"Specifies 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`.\"\n  },\n  \"cols\": 2,\n  \"rows\": 7\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Query Specification\"\n}\n[/block]\nThe 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:\n\n**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.\n**operator** - The operator for the criteria. Search operators allow you to specify relations between the criteria values. Supported operators are listed below.\n**values** - An array of values representing the values of the specified field to filter the search to.\n\nIf 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:\n\n`{\"name\":\"resource_type\", \"operator\":\"=\", \"values\": [\"article\"]},\n{\"name\":\"is_blacklisted\", \"operator\":\"=\", \"values\": [true]}`\n\nwould restrict the result set to articles with that are blacklisted.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Supported Operators\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Values Accepted\",\n    \"h-2\": \"Function\",\n    \"0-0\": \"`=`\",\n    \"0-1\": \"String, Boolean, ISO Timestamp, Number\",\n    \"0-2\": \"Returns 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`.\",\n    \"h-3\": \"Example\",\n    \"0-3\": \"`{\\\"name\\\":\\\"title\\\", \\n\\\"operator\\\":\\\"=\\\",\\n\\\"values\\\":[\\\"Foo\\\", \\\"Bar\\\"]} // returns resources that contain \\\"Foo\\\" or \\\"Bar\\\" as a title.`\\n\\n`{\\\"name\\\":\\\"is_blacklisted\\\", \\\"operator\\\":\\\"=\\\", \\\"values\\\":[true]} // returns resources that have the is_blacklisted field set to true.`\",\n    \"1-0\": \"`NOT`\",\n    \"2-0\": \"`BEFORE`\",\n    \"3-0\": \"`AFTER`\",\n    \"4-0\": \"`BETWEEN`\",\n    \"1-1\": \"String, Boolean, ISO Timestamp, Number\",\n    \"1-2\": \"Returns 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`.\",\n    \"1-3\": \"`{\\\"name\\\":\\\"title\\\", \\n\\\"operator\\\":\\\"NOT\\\",\\n\\\"values\\\":[\\\"Foo\\\", \\\"Bar\\\"]} // returns resources that do not have \\\"Foo\\\" or \\\"Bar\\\" as a title.`\\n\\n`{\\\"name\\\":\\\"is_blacklisted\\\", \\\"operator\\\":\\\"NOT\\\", \\\"values\\\":[true]} // returns resources that have the is_blacklisted field set not to true.`\",\n    \"2-1\": \"A single ISO-8601 Duration Timestamp\",\n    \"3-1\": \"A single ISO-8601 Duration Timestamp\",\n    \"4-1\": \"An array of two ISO-8601 Duration Timestamps\",\n    \"2-2\": \"Returns 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.\",\n    \"3-2\": \"Returns 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.\",\n    \"4-2\": \"Returns 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.\",\n    \"2-3\": \"`{\\\"name\\\":\\\"pubDate\\\", \\\"operator\\\":\\\"AFTER\\\", \\\"values\\\":[\\\"-P1D\\\"]} // returns resources that have a pubDate after 1 day ago.`\",\n    \"3-3\": \"`{\\\"name\\\":\\\"event_start_date\\\", \\\"operator\\\":\\\"AFTER\\\", \\\"values\\\":[\\\"P1D\\\"]} // returns resources that have an event_start_date more than 1 day in the future.`\",\n    \"4-3\": \"`{\\\"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.`\"\n  },\n  \"cols\": 4,\n  \"rows\": 5\n}\n[/block]","updates":[],"order":12,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"576c6810151ca30e00c851c2","category":{"sync":{"isSync":false,"url":""},"pages":["56d4ec8573dcd20b00fb876a"],"title":"Server-Side Integration REST API","slug":"authorization","order":3,"from_sync":false,"reference":true,"_id":"56d4ec4773dcd20b00fb8769","__v":1,"version":"56aff08c3a5b810d00745d9c","createdAt":"2016-03-01T01:11:35.547Z","project":"56aff08c3a5b810d00745d99"},"project":"56aff08c3a5b810d00745d99","user":"566887ff8639090d00759415","__v":12,"createdAt":"2016-06-23T22:52:00.550Z","editedParams":true,"editedParams2":true,"parentDoc":null,"version":{"version":"1","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["56aff08d3a5b810d00745d9d","56aff24f3a5b810d00745da0","56aff25dbc304a0d00ace207","56aff287e0b1e40d00c53798","56aff2b260a37a0d00ed8883","56aff2b8e0b1e40d00c53799","56aff2bd5b1f01170014dc7b","56aff2c9d21e9c0d00b62993","56aff493aef9a21700da0e67","56aff4ce1486990d009c0f64","56aff4da5b1f01170014dc7d","56aff4dfe0b1e40d00c537a2","56aff4e59d32e30d0006d3e9","56aff4e91486990d009c0f65","56aff4f93a5b810d00745da2","56aff4fe9d32e30d0006d3ea","56b91c7ab1e03e0d001057c5","56c4f51aba4a540d0091b9a2","56cd09488c4a331d002c1e44","56d4ec4773dcd20b00fb8769","56e79bc515f96b2200878e54","56ec25c538ff1d2200d56cc2","56ec3a6f36bc8e0e00f190c8","56ec3e308ea7ce0e00a3d8b0","5724d8fe4255580e005938b2","5724dc842ad0bc1700122803","5776ef2a04f7500e0095dc37","57ab9f70b5e8742000e17eb9","57d7117646dcc30e007dd21f","58e6abd5b1eece19008b7d31","59288c65e2653627003e1221","5a8f4797a44f8600128e75ee","5bbf8833eb416300039a2c14","5ea811617bf4b5007328a0af"],"_id":"56aff08c3a5b810d00745d9c","project":"56aff08c3a5b810d00745d99","releaseDate":"2016-02-01T23:55:56.544Z","__v":34,"createdAt":"2016-02-01T23:55:56.544Z"},"githubsync":""}

postGet a List of Resources

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

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

site_id:
required
string
The unique identifier for your Boomtrain site.

Body Params

data.count:
integer10
Determines the number of results to return. Maximum is 100.
data.sort:
stringbt_updated_at
Specifies a resource field to sort the result set by. Default is `bt_updated_at`, or sorted from most to least recently modified. See Sort Specification below for more details.
data.query:
array of objects
Array representing a list of search criteria. See Query Specification below for details.

Examples


Result Format


Documentation

[block:api-header] { "title": "Sort Specification" } [/block] The `data.sort` option must be in the form of an allowed field name: [block:parameters] { "data": { "h-0": "Field", "0-0": "`bt_updated_at`", "2-0": "`bt_statistics.viewed.cumulative.P7D`", "3-0": "`bt_statistics.viewed.cumulative.P1D`", "h-1": "Description", "0-1": "Sort by the time Boomtrain last checked on this resource, most recently to least recently.", "2-1": "Sort by the number of views in the last 7 days, most to least.", "3-1": "Sort by the number of views in the last 1 day, most to least.", "1-0": "`recency`", "1-1": "Sort 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.", "4-0": "`field`", "4-1": "Sort 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.", "5-0": "`field_name`", "5-1": "Specifies 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.", "6-0": "`sort_order`", "6-1": "Specifies 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`." }, "cols": 2, "rows": 7 } [/block] [block:api-header] { "type": "basic", "title": "Query Specification" } [/block] 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. [block:api-header] { "type": "basic", "title": "Supported Operators" } [/block] [block:parameters] { "data": { "h-0": "Field", "h-1": "Values Accepted", "h-2": "Function", "0-0": "`=`", "0-1": "String, Boolean, ISO Timestamp, Number", "0-2": "Returns 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`.", "h-3": "Example", "0-3": "`{\"name\":\"title\", \n\"operator\":\"=\",\n\"values\":[\"Foo\", \"Bar\"]} // returns resources that contain \"Foo\" or \"Bar\" as a title.`\n\n`{\"name\":\"is_blacklisted\", \"operator\":\"=\", \"values\":[true]} // returns resources that have the is_blacklisted field set to true.`", "1-0": "`NOT`", "2-0": "`BEFORE`", "3-0": "`AFTER`", "4-0": "`BETWEEN`", "1-1": "String, Boolean, ISO Timestamp, Number", "1-2": "Returns 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`.", "1-3": "`{\"name\":\"title\", \n\"operator\":\"NOT\",\n\"values\":[\"Foo\", \"Bar\"]} // returns resources that do not have \"Foo\" or \"Bar\" as a title.`\n\n`{\"name\":\"is_blacklisted\", \"operator\":\"NOT\", \"values\":[true]} // returns resources that have the is_blacklisted field set not to true.`", "2-1": "A single ISO-8601 Duration Timestamp", "3-1": "A single ISO-8601 Duration Timestamp", "4-1": "An array of two ISO-8601 Duration Timestamps", "2-2": "Returns 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.", "3-2": "Returns 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.", "4-2": "Returns 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.", "2-3": "`{\"name\":\"pubDate\", \"operator\":\"AFTER\", \"values\":[\"-P1D\"]} // returns resources that have a pubDate after 1 day ago.`", "3-3": "`{\"name\":\"event_start_date\", \"operator\":\"AFTER\", \"values\":[\"P1D\"]} // returns resources that have an event_start_date more than 1 day in the future.`", "4-3": "`{\"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.`" }, "cols": 4, "rows": 5 } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}