Recommendations
Recommend For Products And User
Returns an object with an array of recommendation displays.
POST
/
v2
/
recommend
/
products
/
products
Authorization
Header
Body
curl --request POST \
--url https://api.depict.ai/v2/recommend/products/products \
--header 'Content-Type: application/json' \
--data '{
"document_referrer": "<string>",
"dsid": "<string>",
"market": "<string>",
"metadata": {},
"product_ids": [
"<string>"
],
"session_id": "<string>",
"tenant": "<string>",
"type": "<string>",
"user_id": "<string>"
}'
{
"displays": [{
"title": "Mechanical Keyboard",
"price": "100.00",
"image_url": "https://my_store.com/awesome_mechanical_keyboard.jpeg",
"page_url": "https://my_store.com/awesome_mechanical_keyboard.html",
"product_id": "awesome_mechanical_keyboard",
"recommendation_id": "827ada29-92e7-4642-8805-8b7105a9c8a5"
}]
}
Each display will contain a recommendation_id (which is also present as a URL parameter in display.page_url
). The recommendation_id should be sent to the create-events
endpoint if the user interacts with the recommendation. This is typically achieved by storing the recommendation as a data attribute on the HTML element containing the recommendation.
Authorizations
api_key
string
queryrequiredHeaders
referer
string
Body
application/json
document_referrer
string
dsid
string
Populated for integrations performed by Depict.ai only. Depict.ai Session Id
market
string
requiredMarket identifier
metadata
object
Metadata that can be used to modify the behaviour of the recommendation system
product_ids
string[]
requiredsession_id
string
Session identifier
tenant
string
requiredIdentifier associated with the API integration
type
string
requiredType of the recommendation, e.g. cross_sell
user_id
string
Customer identifier
Response
200 - application/json
displays
object[]
requirederror
string
experiment_id
string
variant
integer
Was this page helpful?
curl --request POST \
--url https://api.depict.ai/v2/recommend/products/products \
--header 'Content-Type: application/json' \
--data '{
"document_referrer": "<string>",
"dsid": "<string>",
"market": "<string>",
"metadata": {},
"product_ids": [
"<string>"
],
"session_id": "<string>",
"tenant": "<string>",
"type": "<string>",
"user_id": "<string>"
}'
{
"displays": [{
"title": "Mechanical Keyboard",
"price": "100.00",
"image_url": "https://my_store.com/awesome_mechanical_keyboard.jpeg",
"page_url": "https://my_store.com/awesome_mechanical_keyboard.html",
"product_id": "awesome_mechanical_keyboard",
"recommendation_id": "827ada29-92e7-4642-8805-8b7105a9c8a5"
}]
}