Instant Search [GET]
Overview
Supply a valid token and site name along with the search phrase to get instant search results.
Parameters
Parameter | Type | Description |
---|---|---|
Token | string (query) | Token supplied during on-boarding or can be generated from within RCMAdmin. |
SiteName | string (query) | This is the site name used to describe your regional version of the website, as supplied in the feeds to RCM. |
SearchPhrase | string | This is the search phrase the customer has typed into the search bar. |
Limit | integer($int32) | Limit the amount of products returned back. i.e. to show no more than 5 send 5 as the Limit. |
ResultsType | string (query) | Set the amount of product data to return. This can be either IDS or PRODUCT. |
Currency | string | Currency of products to be returned back. This assumes you have supplied products in these currencies. Use the 3 Digit ISO code. |
Example API call
V.Search.get({
query: "shirt",
take: 10,
popularSearchCount: 5,
trendingProductCount: 5,
fullProductData: true,
}, (error, data) => {
const test = JSON.stringify(data, null, 4);
const elm = document.querySelector('#search-json');
elm.innerHTML = "<pre>" + test + "</pre>";
});
Example Result
200 response
{
"searchPhrase": "string",
"didYouMeanPhrases": [
"string"
],
"autoFillSuggestions": "string",
"totalMatchedItems": 0,
"results": [
{
"RCMProductId": 0,
"thirdPartyProductId": "string",
"productCode": "string",
"title": "string",
"price": 0,
"salePrice": 0,
"rrp": 0,
"productUrl": "string",
"imageUrl": "string",
"position": 0,
"currency": "string"
}
],
"productIds": [
0
],
"trackingData": {
"action": 0,
"pageId": 0,
"ruleId": 0,
"matchedRules": [
"string"
]
},
"responseTime": "string",
"token": "string"
}
Search Page [GET]
Overview
Supply a valid token and site name with a search phrase to retrieve the full merch page JSON data.
Parameters
Parameter | Type | Description |
---|---|---|
Token | string (query) | Token supplied during on-boarding or can be generated from within RCMAdmin. |
SiteName | string (query) | This is the site name used to describe your regional version of the website, as supplied in the feeds to RCM. |
SearchPhrase | string | This is the search phrase the customer has typed into the search bar. |
Currency | string (query) | 3 Digit ISO Currency code. for example. GDP, FRA, USD etc. |
Take | integer($int32) (query) | How many products to get, i.e. 10 products |
Skip | integer($int32) (query) | CHow many products to skip, for example if we are showing 10 products per page and are page two we would supply skip the first 10. |
SortBy | string (query) | Which Sort to apply to the dataset. |
FilterByIds | array[integer] (query) | Which Facets are currently selected. |
Example API Call
blank
Example Result
200 response
{
"title": "string",
"url": "string",
"metaTitle": "string",
"metaDescription": "string",
"pageContent": "string",
"onPageTitle": "string",
"onPageDescription": "string",
"ruleId": 0,
"totalProducts": 0,
"adverts": [
{
"title": "string",
"image": "string",
"position": 0,
"url": "string"
}
],
"facets": [
{
"facetId": 0,
"position": 0,
"collapsed": true,
"defaultCount": 0,
"numberOfColumns": 0,
"facetName": "string",
"facetValues": [
{
"facetId": 0,
"facetValueId": 0,
"facetName": "string",
"facetValue": "string",
"position": 0,
"count": 0
}
]
}
],
"products": [
{
"productCode": "string",
"title": "string",
"description": "string",
"productUrl": "string",
"imageUrl": "string",
"RCMProductId": 0,
"thirdPartyProductId": "string",
"rank": 0,
"price": 0,
"rrp": 0,
"isAdvert": true
}
]
}