Create Request Tag Rule

To create a rule for the previous example, you can use the following endpoint:

curl -X PATCH -H "Content-Type: application/json" -d '{
"boost_rules":[
{
"active":true,
"automatically_generated":false,
"rule":{
"boost":0.48,
"filters":{
"group_id":[
"48"
]
}
},
"start_time": "2020-07-01 00:00:00",
"end_time": "2020-07-14 00:00:00"
}
]
}' -u"[your token]:" "https://ac.cnstrc.com/refined_tags/user_segment/segment1?key=[key]"

This request will replace existing rules for the user_segment:segment1 key-value pair with the single boost rule provided in the request body.

info

The above command(s) return a 200 Success response on success.

HTTP Request#

PATCH https://ac.cnstrc.com/refined_tags/[tag_name]/[tag_value]?key=[key]

Response format#

{
"allow_automatic_rules": true,
"boost_rules": [
{
"active": true,
"automatically_generated": false,
"created_at": "2020-07-03T17:41:56",
"end_time": null,
"rule": {
"boost": 0.48,
"filters": {
"group_id": ["48"]
}
},
"rule_type": "BOOST",
"start_time": "2020-07-01 00:00:00",
"end_time": "2020-07-14 00:00:00",
"updated_at": null
}
],
"tag_name": "user_segment",
"tag_value": "segment1"
}

URL Parameters#

ParameterDescription
tag_nameThe name of the tag you'd like to retrieve rules for.
tag_valueThe value of the tag you'd like to retrieve rules for.

Query JSON Parameters#

ParameterRequired?Description
boost_rulesYesList of boost rules that will be applied for matching requests.

Each boost_rule object has the following structure:

ParameterRequired?Description
ruleYesAn object with a boost field and a filters field, documented below.
activeNoYour rule can be defined but set to inactive if you wish by setting the active field to false.
automatically_generatedNoRules that are generated automatically by Constructor are flagged with true.
start_timeNoStart time when the rule should be enabled.
end_timeNoEnd time when the rule should be disabled.

Each rule object has the following structure:

ParameterRequired?Description
boostYesA value in the range of -1 to +1 representing the standard deviations by which matching items' ranking score should be decreased or increased.
filtersYesIndicates the properties of the products to which this boost should be applied. For more examples of filter expressions, refer to Retrieve searchandizing rules.