Retrieve Rules

To retrieve searchandizing rules for a collection, use the GET method on the refined_collections endpoint.

curl -X GET -H "Content-Type: application/json" \
-u"[your token]:" \
"https://ac.cnstrc.com/v1/refined_collections/cat%20playthings?key=[your index key]&section=[section]"
curl -X GET -H "Content-Type: application/json" \
-u"[your token]:" \
"https://ac.cnstrc.com/v1/refined_collections?key=[your index key]&section=[section]"
info

The above command returns a 204 Success response on success.

HTTP Requests#

GET https://ac.cnstrc.com/v1/refined_collections/[collection_id]?key=[your index key]&section=[section]

Response format#

{
"refined_collections": [
{
"id": 10111,
"allow_automatic_rules": false,
"blacklist_rules": [
{
"active": true,
"automatically_generated": false,
"created_at": "2020-04-07T13:45:42",
"end_time": null,
"rule": { "filters": { "type": ["food"] } },
"rule_type": "BLACKLIST",
"start_time": null,
"updated_at": null
}
],
"boost_rules": [
{
"active": true,
"automatically_generated": false,
"created_at": "2020-04-07T13:45:42",
"end_time": null,
"rule": { "filters": { "boost": 1.0, "color": ["red"] } },
"rule_type": "BOOST",
"start_time": null,
"updated_at": null
}
],
"collection_id": "cat playthings",
"slot_rules": [
{
"active": true,
"automatically_generated": false,
"created_at": "2020-04-07T13:45:42",
"end_time": "2020-04-17T13:45:42",
"rule": { "item_id": "yarn_ball", "position": 1 },
"rule_type": "SLOT",
"start_time": "2020-04-07T13:45:42",
"updated_at": null
}
],
"whitelist_rule": {
"active": true,
"automatically_generated": false,
"created_at": "2020-04-07T13:45:42",
"end_time": null,
"rule": { "filters": { "brand": ["cat toys"] } },
"rule_type": "WHITELIST",
"start_time": null,
"updated_at": null
}
}
],
"total_count": 1
}

URL Parameters#

ParameterDescription
collection_idThe id of the collection you'd like to retrieve searchandizing rules for.

Query Parameters#

ParameterRequired?Description
sectionYesThe index section you'd like to retrieve searchandizing rules from (typically Products).
num_results_per_pageNoThe number of rules to return. Defaults to 100.
pageNoThe page of results to return. Defaults to 1.