Content list on search page¶
Querying the search-page
endpoint using the GET
method will return a product list in the search results. Including content list(s) in the search page results page can be achieved by supplying a page configuration and sending the query using the POST
method.
Example¶
Below is an example of a query to the search-page
endpoint to also include a content list.
//request-body.json
{
"contentLists": [
{ "id": "all-content" }
]
}
#!/bin/bash
curl -X POST \
"https://{cluster-id}.api.esales.apptus.cloud/api/storefront/v3/queries/search-page?market=US&locale=en-US&sessionKey=4b116e34-0a7a-ce5d-5591-75c62f231967&customerKey=4b116e34-0a7a-ce5d-5591-75c62f231967&touchpoint=DESKTOP&q=store" \
-H 'Content-Type: application/json' \
-d @request-body.json
const api = esales({ clusterId: 'w00000000', market: 'US', locale: 'en-US', touchpoint: 'desktop' });
const results = await api.query.searchPage(
{ q: 'store' },
{
contentLists: [
{ id: 'all-content' }
]
}
);
To include certain content lists, a content filter can also be specified in the request body as shown in the example below. For more information, see Content filters.
Example¶
The request body below will limit the Elevate response to content with the type=inspiration
. The attribute type
must be provided in the data feed for the filter to take effect.
{
"contentLists": [
{
"id": "articles",
"contentFilter": {
"type": "inspiration"
}
}
]
}