PageView
Pageview API call is used to request PA Recommendations widget configuration, product slots, and any related configuration. This API call will return products, and respective configurations for the route requested.
Request
Method: GET
Endpoint: /2.7/PageView
curl --location 'https://RECS_API_BASE_URL/2.7/PageView?w=WEBSITE_ID&p=PRODUCT_ID&r=URL_ENCODED_CURRENT_URL&c=CUSTOMER_ID&rcc=CURRENCY_CODE&rcl=CURRENT_LANGUAGE' \
--header 'authority: RECS_API_BASE_HOST' \
--header 'accept: */*'
Parameters
Name | Type | Description | Requirements |
---|---|---|---|
w | GUID | Website ID | Required. |
c | GUID | Customer ID | Not Required. Available in config API call |
p | String | Product Ref ID | Not required. The Id is only available in product details page. This is used for tactics where response is expected in relation to the current product. For example - recommendation of other products related to the current product, or filter results based on the current product category etc.. |
r | String | Current route | Required. Current URL |
rcl | String | Current language | Required. Not required if the website only has one language. Follow IETF language tag Example: 'en-AU' |
rcc | String | Current currency code | Not required. Not required if the website only has one currency. |
Response
The original response is quite long but we will describe only the relevant part of the response here.
Format: JSON
{
"payload": {
"wavt": [],
"recs": [
{
"s": [
{
"slot": 0,
"label": "1",
"slotId": "SLOT_ID",
"tacticId": "TACTIC_ID",
"campaignId": "CAMPAIGN_ID",
"recommenderId": "RECOMMENDER_ID",
"products": [
{
"id": "ID",
"refId": "12360",
"name": "XXX-YYY-ZZZ",
"sku": "PRODUCT_SKU",
"description": "Product Description",
"price": "$17.30",
"imageURL": [
"PRODUCT_IMAGE_URL"
],
"url": "PRODUCT_PAGE_URL",
"isInStock": true,
"brandId": "BRAND_ID",
"brand": {
"name": "XXX-YYY"
},
"prices": [
{
"code": "NZD",
"symbol": "$",
"price": 17.3,
"rawPrice": "$17.30"
}
],
"attributes": [
{
"name": "Product_Retail_Price",
"type": 504,
"stringValue": "$15.00",
"options": [],
"valueType": 0
},
{
"name": "Menu_Category_Level_1",
"type": 9100,
"stringValue": "Food & Drink",
"options": [],
"valueType": 0
}
],
}
]
}
]
}
],
"rpu": true,
"piis": true
},
"type": 1,
"code": 0
}
Response Fields
Key | SubKey | Name | Description |
---|---|---|---|
payload.recs | Recommendations | An array of recommendations based on the widgets that matched the current route | |
payload.recs[x].s | Recommendation slots | An array of Slot objects. Each recommended product is returned as a slot. The structure and data of the product slot object will depend upon the product attributes. | |
payload.recs[x].s[y].slot | Slot number | ||
payload.recs[x].s[y].slotId | Slot Id | ||
payload.recs[x].s[y].campaignId | Campaign Id | ||
payload.recs[x].s[y].recommenderId | Recommender Id | ||
payload.recs[x].s[y].tacticId | Tactic Id | ||
payload.recs[x].s[y].products | The product detail and attributes. It is returned as an array of object. | ||
payload.recs[x].s[y].products[z].id | Product Id, PA generated | The product id in the system | |
payload.recs[x].s[y].products[z].refId | The product Ref Id | This is the product unique identifier of the store | |
payload.recs[x].s[y].products[z].name | Product Name | The product name | |
payload.recs[x].s[y].products[z].sku | Product SKU | The product sku | |
payload.recs[x].s[y].products[z].description | Product Description | ||
payload.recs[x].s[y].products[z].price | Product Price | ||
payload.recs[x].s[y].products[z].imageURL | Product Image URL | An array of product image URL's | |
payload.recs[x].s[y].products[z].url | Product Page URL | ||
payload.recs[x].s[y].products[z].prices | Product Prices object | This is an array of object. Returns when the store supports multi currency. | |
payload.recs[x].s[y].products[z].isInStock | Product stock information | True/False Boolean Value | |
payload.recs[x].s[y].products[z].brandId | Brand Id | Not always available | |
payload.recs[x].s[y].products[z].brand | The brand object | Not always available | |
payload.recs[x].s[y].products[z].brand.name | Product Brand Name | Not always available | |
payload.recs[x].s[y].products[z].attributes | Product Attributes | An array of product attribute objects |