Report that product blocks or banner blocks were seen
- Path
/impressions/{accessToken}- Auth
- Access token · in the URL path
const url = 'https://releva.ai/api/v0/impressions/YOUR_ACCESS_TOKEN';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"recommenders":[{"token":"8b0e6f3a-2c4d-4e5f-9a1b-3c2d1e0f9a8b","productFeedId":"37","segmentId":"1"}],"profileId":"demo-device-pb-1","deviceId":"demo-device-pb-1","sessionId":"demo-session-pb-1","url":"https://demo-store.example.com/products/linen-summer-shirt"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://releva.ai/api/v0/impressions/YOUR_ACCESS_TOKEN \ --header 'Content-Type: application/json' \ --data '{ "recommenders": [ { "token": "8b0e6f3a-2c4d-4e5f-9a1b-3c2d1e0f9a8b", "productFeedId": "37", "segmentId": "1" } ], "profileId": "demo-device-pb-1", "deviceId": "demo-device-pb-1", "sessionId": "demo-session-pb-1", "url": "https://demo-store.example.com/products/linen-summer-shirt" }'Records one recommenderImpression (or bannerImpression) event per item. The SDK calls it automatically when
at least 25% of a block it drew is visible, once per block per page load. Call it yourself only for blocks you
render from the push callback. Copy token, productFeedId and segmentId from the push response, as strings.
The access token can also be sent as authorization: Bearer <accessToken> on /impressions.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The shop’s access token.
Example
YOUR_ACCESS_TOKENRequest Bodyrequired
Section titled “Request Bodyrequired”At least one of recommenders or banners, and at least one of profileId or deviceId.
object
object
object
Example
{ "recommenders": [ { "token": "8b0e6f3a-2c4d-4e5f-9a1b-3c2d1e0f9a8b", "productFeedId": "37", "segmentId": "1" } ], "profileId": "demo-device-pb-1", "deviceId": "demo-device-pb-1", "sessionId": "demo-session-pb-1", "url": "https://demo-store.example.com/products/linen-summer-shirt"}Responses
Section titled “Responses”Impressions recorded.
object
Example
{}Authentication or validation error. The handler’s own checks answer with an error property; validation and
authentication answer with message.
object
Human-readable error. Several validation errors are joined with a space.
object
Examples
{ "error": "One of profileId or deviceId is required"}{ "error": "At least one of banners or recommenders must be provided"}{ "message": "The 'recommenders[0].productFeedId' field must be a string."}{ "message": "The object 'recommenders[0]' contains forbidden keys: 'position'."}{ "message": "Authorization header is missing, and accessToken url parameters is also missing. At least one of them is required."}The domain is disabled.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "Domain is disabled. Please reach out to support@releva.ai to enable it."}Unexpected server error.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "An internal error occurred."}