Panel Query¶
Panel queries are the main way of fetching results, such as products or ads from eSales Enterprise. Panels can be queried through the Web API when the panel hierarchy for a site has been published. A successful query returns the panel content in flattened and serialised JSON format.
Parameters that have not been set in panel configuration or have a default value in predefined panels has to be sent as arguments.
Method¶
GET
URL format¶
/api/v1/panels/{panelPath}?{parameter_name}={parameter_value}
Required Parameters¶
Name | Type | Description | Example |
---|---|---|---|
market | string | Visitor Market | Sweden |
customerKey | string | Visitor id. SHA256 hash if the visitor is signed in, otherwise a UUID / GUID. | 5G7HJ...R77T1 |
sessionKey | string | A unique id. UUID / GUID. | 2F75A...EAFA6 |
panelPath | string | Panel path | /product-page |
token | string | Unique token generated by the CustomerKeyAuthentication class. Should only be set for signed in visitors. | EAFA6...2F75A |
Other Parameters¶
Additional arguments are panel dependent and may be required. All arguments, including filter variables, must be prepended with arg.
. See Panels for parameters for panel specific arguments.
/api/v1/panels/{panelPath}?arg.{parameter_name}={parameter_value}
Request body¶
Not applicable
Request content-type¶
Not applicable
Response content-type¶
application/json
Responses¶
Response | Description |
---|---|
200 | Panel content flattened and serialised to JSON, see Response. |
400 | Invalid or missing arguments for this panel. |
403 | A SHA256 customer key was used, but it could not be validated. |
404 | Panel not found or not public. |
503 | Service unavailable, no products found in cluster. |
5xx | Server error such as cluster unavailable or busy. The response body may contain more information about the error. |
Example¶
Try out the API at the Apptus API Playground with your eSales Playground and API credentials.
Request¶
cURL¶
#!/bin/bash
curl -i \
"https://{cluster-id}.api.esales.apptus.cloud/api/v1/panels/product-list?market=UK&customerKey=d9528030-509c-4e0f-b585-7168f1e9feca&sessionKey=b106299c-eac0-4f6f-96d2-93e57c255784&arg.window_first=1&arg.window_last=10"
Response¶
JSON
{
"productList": [
{
"name": "product-list",
"ticket": "Oy9wcm9kdWN0LWxpc3Q7IzsjOyM7IzsjOyM7Izs",
"path": "/product-list",
"displayName": "Product List",
"description": "Displays a list of products and is intended to be used for static searches.",
"attributes": {},
"resultType": "products",
"products": [
{
"key": "P_555452-0446_UK",
"ticket": "Oy9wcm9kdWN0LWxpc3Q7Iztwcm9kdWN0X2tleTtQXzU1NTQ1Mi0wNDQ2X1VLOyM7T0JKRUNUSVZFJDtOT05FOk5PTkU7NjE7",
"variants": [],
"attributes": {
"availability": "InStock",
"campaign": "Summer",
"campaignPrice": "69.95",
"category": "Dresses|Party dresses",
"color": "red",
"description": "Dress from Elise Ryan. Lace bodice and wraparound-style neckline with V-neck. Hidden zipper closure at back. Gathered, wraparound-style front. Partially lined. Hand wash recommended. NOTE: Fits small. Waist is non-stretchy. Made of 100% Polyester.",
"image": "http://localhost:3000/static/images/555452-0446.jpeg",
"isDiscontinued": "false",
"market": "UK",
"name": "Maxi Lace Cross Front",
"price": "84.95",
"priceCurrency": "€",
"productId": "P_555452-0446",
"product_key": "P_555452-0446_UK",
"rank": "1",
"relevance": "1.0",
"tag1": "long",
"tag2": "cotton",
"url": "http://localhost:3000/product/P_555452-0446"
}
},
{
"key": "P_265604-0023_UK",
"ticket": "Oy9wcm9kdWN0LWxpc3Q7Iztwcm9kdWN0X2tleTtQXzI2NTYwNC0wMDIzX1VLOyM7T0JKRUNUSVZFJDtOT05FOk5PTkU7NjE7",
"variants": [],
"attributes": {
"availability": "InStock",
"category": "Dresses|Party dresses",
"color": "gold",
"description": "Sequin dress with three-quarter sleeves from Club L Essentials. Low, slight V-neck at back. Lined. Made of 100% Polyester.",
"image": "http://localhost:3000/static/images/265604-0023.jpeg",
"market": "UK",
"name": "Sequin Bodycon Dress",
"price": "42.95",
"priceCurrency": "€",
"productId": "P_265604-0023",
"product_key": "P_265604-0023_UK",
"rank": "2",
"relevance": "0.5",
"tag1": "short",
"tag2": "polyester",
"url": "http://localhost:3000/product/P_265604-0023"
}
},
{
"key": "P_125383-0014_UK",
"ticket": "Oy9wcm9kdWN0LWxpc3Q7Iztwcm9kdWN0X2tleTtQXzEyNTM4My0wMDE0X1VLOyM7T0JKRUNUSVZFJDtOT05FOk5PTkU7NjE7",
"variants": [],
"attributes": {
"availability": "InStock",
"campaign": "Summer",
"campaignPrice": "19.95",
"category": "Dresses|Party dresses",
"color": "black",
"description": "Asymmetric cut jersey dress from One. Soft scuba quality. Wrap-around v-neckline and eyelets in the waist band in the front. Made of 92% Polyester and 8% Elastane.",
"image": "http://localhost:3000/static/images/125383-0014.jpeg",
"isDiscontinued": "true",
"market": "UK",
"name": "Assymetric Eyelet Trim Dress",
"price": "39.95",
"priceCurrency": "€",
"productId": "P_125383-0014",
"product_key": "P_125383-0014_UK",
"rank": "3",
"relevance": "0.3333333333333333",
"tag1": "short",
"tag2": "polyester",
"url": "http://localhost:3000/product/P_125383-0014"
}
}
]
}
]
}
}