Batch Patch Items

search suggestions
curl -X PATCH -H "Content-Type: application/json" \
-d '{"items": [ {"item_name": "Golden Retriever"}, {"item_name": "Poodle"} ],
"section":"Search Suggestions"}' \
-u"[your token]:" "https://ac.cnstrc.com/v1/batch_items?key=[your API key]"
products
curl -X PATCH -H "Content-Type: application/json" \
-d '{
"section":"Products",
"items": [
{
"item_name": "Labradoodle",
"suggested_score": 360,
"keywords": ["poodle","labrador","retriever"],
"url": "http://www.mydogs.com/labradoodle",
"image_url": "https://images.mydogs.com/labradoodle.jpg",
"description": "A crossbreed dog created by crossing the Labrador Retriever and the Poodle",
"metadata": { "animal": "dog" },
"group_ids": [ "23", "45" ]
},
{
"item_name": "Australian Shepherd",
"suggested_score": 130,
"keywords": ["aussie"],
"url": "http://www.mydogs.com/australian_shepherd",
"image_url": "https://images.mydogs.com/australian_shepherd.jpg",
"description": "A medium-sized breed of dog developed on ranches in the Western United States",
"metadata": { "animal": "dog" },
"group_ids": [ "67", "89" ]
}
]
}' \
-u"[your token]:" "https://ac.cnstrc.com/v1/batch_items?key=[your API key]"
info

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

To patch multiple items to your index as a batch, use the PATCH /batch_items call. The items parameter is required and is a list of items with the same attributes as defined in the Patch an Item resource. Because your autosuggest and search results can have multiple sections, like categories, search suggestions, and direct links to products, you must specify which section you are patching an item from. You can do this with the section parameter.

There is a limit of 1,000 items per batch request.

HTTP Request#

PATCH https://ac.cnstrc.com/v1/batch_items?key=[your API key]

JSON Parameters#

ParameterRequired?Description
itemsYesA list of items with the same attributes as defined in the Patch an Item resource
sectionYesYour autosuggest and search results can have multiple sections like "Products" and "Search Suggestions". This indicates which section this item is for. See your dashboard for the section names to use.