Content Search Page¶
The content search page query is intended to be used on a separate part of a site, such as an FAQ or a customer service section. A content search page query will return a search result content listing with applicable sort orders and total hits.
Request¶
Request method¶
GET
or POST
Request URL¶
https://{cluster-id}.api.esales.apptus.cloud/api/v2/queries/content-search-page
Request parameters¶
Name | Type | Description | Example |
---|---|---|---|
market | string | The visitor market identifier. Must match the corresponding market identifier in the data feed. Required | UK |
touchpoint | string | The visitor's touchpoint. Valid values are DESKTOP and MOBILE . Required | DESKTOP |
customerKey | string | A key that uniquely identifies the current visitor. Using UUIDs as keys are recommended. Required | 0b05119e-eeb8-418a-bbfb-defa0dde417e |
sessionKey | string | A unique key, identifying the session. Using UUIDs as keys are recommended. Required | 0b05119e-eeb8-418a-bbfb-defa0dde417e |
q | string | The executed search query. Required | shipping |
origin | string | The Search origin of the search phrase. Defaults to ORGANIC . | UNDO_AUTO_CORRECT |
limit | int | The number of content items to list. Defaults to 60 if omitted in the query. | 60 |
skip | int | The number of content items to skip. Used for pagination, defaults to 0 if omitted in the query. | 48 |
sort | string | The applied Sort order in the search result. Strongly recommended to omit for initial searches. Only recommended for explicit visitor interaction after initial searches. | NEWEST_FIRST |
notify | boolean | A boolean that can be used to disable notifications and behavioural registration for the query. | false |
Search origin¶
To correctly track and analyse search behaviour, searches that originate from autocomplete suggestions, triggered through did-you-mean, or are actual organic searches are differentiated.
Name | Description |
---|---|
ORGANIC | The search was organic, e.g. the phrase was typed and executed by a visitor without any assistance or suggestion interaction. |
DID_YOU_MEAN | The search phrase originated from a did-you-mean suggestion in the search. |
UNDO_AUTO_CORRECT | A search phrase which forcibly omits autocorrect. Used when visitors have phrases autocorrected, and are presented with the option to redo the search using the original phrase. |
Request headers¶
All request headers are optional, but recommended when eligible.
Content-Type
-application/json
. To prevent automatic browser preflight requests,text/plain
is also supported.Accept-Encoding
-gzip
. Allows responses to be compressed using Gzip.User-Agent
- User agent. Enables internal tracking.
Request body¶
The search result of the content search page can be configured to be restricted through a content filter.
Name | Type | Description |
---|---|---|
primaryList | PrimaryList | A configuration object allowing filter restrictions of the primary listing, i.e. the search results. |
Primary list¶
Request example
{
"primaryList": {
"contentFilter": {
"type": "faq"
}
}
}
Name | Type | Description |
---|---|---|
contentFilter | ContentFilter | A content filter restricting which content that the listing may contain. |
Request example¶
A content search page query example is demonstrated using cURL below.
#!/bin/bash
curl -i \
-H "Accept-Encoding: gzip" \
-H "User-Agent: {client user agent}" \
"https://{cluster-id}.api.esales.apptus.cloud/api/v2/queries/content-search-page?market=EU&sessionKey=4b116e34-0a7a-ce5d-5591-75c62f231967&customerKey=4b116e34-0a7a-ce5d-5591-75c62f231967&touchpoint=DESKTOP&q=shiping&limit=24"
Request example 2¶
A content search page query example using POST is demonstrated below.
#!/bin/bash
curl -i \
-X POST \
-T request-body.json \
-H "Content-Type: text/plain" \
-H "Accept-Encoding: gzip" \
-H "User-Agent: {client user agent}" \
"
https://{cluster-id}.api.esales.apptus.cloud/api/v2/queries/content-search-page?market=EU&sessionKey=4b116e34-0a7a-ce5d-5591-75c62f231967&customerKey=4b116e34-0a7a-ce5d-5591-75c62f231967&touchpoint=DESKTOP&q=shipping&limit=24"
request-body.json¶
{
"primaryList": {
"contentFilter": {
"type": "article"
}
}
}
Response¶
Response headers¶
X-Response-Time
Response content-type¶
application/json
Response codes¶
Response | Description |
---|---|
200 | Query accepted, content flattened and serialised to JSON, see Response objects. |
400 | Invalid or missing arguments for this query. |
404 | End point is not valid. |
503 | Service unavailable, no products found in the cluster. |
5xx | Server error such as cluster unavailable or busy. The response body may contain more information about the error. |
Response objects¶
JSON
{
"q" : "shiping",
"autoCorrect": {
"q": "shipping",
"originalTotalHits": 0
},
"didYouMean": [],
"primaryList" : {
"totalHits": 3,
"items": [
{
"key": "S1",
"type": "article",
"title": "Shipping",
"link": "/shipping",
"ticket": "Oy9mYXNoaW9uL0RFU0tUT1AvQ09OVEVOVF9TRUFSQ0hfUEFHRS9QUklNQVJZX0xJU1Q7Iztjb250ZW50X2tleTtkMDAxOyM7IzsjOyM7",
"releaseDate": "2019-12-01T00:00:00Z",
"description": "We ship to all of the EU.",
"image": {
"sources": [{"url": "img-w500.jpg", "width": 500}, {"url": "img-w1000.jpg", "width": 1000}]
},
"custom": {
"internalId": ["123456"],
"author": ["Pelle"]
}
},
// Potentially more content items
],
"sort": {
"selected": "RELEVANCE",
"options": [
{"id" : "RELEVANCE", "label": "Most popular"},
{"id" : "NEWEST_FIRST", "label": "Newest first"}
]
}
}
}
Name | Type | Description |
---|---|---|
primaryList | PrimaryList | A content list with the search result. |
q | string | The search query used for the current result. May be corrected and differ from the requested query. |
didYouMean | DidYouMean[ ] | A list of did-you-mean suggestions. |
autoCorrect? | AutoCorrect | Information about applied auto corrections to the search phrase. Omitted if no correction was made. |
PrimaryList¶
Name | Type | Description |
---|---|---|
sort | Sort | How the content is sorted and the available sort options. |
items | ContentItem[ ] | A list of the result of the search. |
totalHits | number | The total number of content item hits. |
Sort¶
Name | Type | Description |
---|---|---|
selected | SortType | Which sort type is currently selected. |
options | SortOptions[ ] | Which sort types to choose from. |
SortOption¶
Name | Type | Description |
---|---|---|
id | SortType | Identifier for the SortOption. |
label | string | The presentation text for the SortOption. |
SortType¶
Name | Description |
---|---|
RELEVANCE | The most relevant content first, based on the match with the query and clicks on content. |
NEWEST_FIRST | The newest content first, determined by release date provided in the product feed. |