Skip to content

Area: Developers

POST

Report that product blocks or banner blocks were seen

Path
/impressions/{accessToken}
Auth
Access token · in the URL path
POST
/impressions/{accessToken}
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.

accessToken
required
string format: uuid

The shop’s access token.

Example

YOUR_ACCESS_TOKEN
Media typeapplication/json

At least one of recommenders or banners, and at least one of profileId or deviceId.

object
recommenders
Array<object>
object
token
required
string format: uuid
productFeedId
required
string
segmentId
required
string
banners
Array<object>
object
token
required
string format: uuid
bannerId
required
string
segmentId
required
string
profileId
string | null
deviceId
string
sessionId
string
email
string format: email
phoneNumber
string
url
string

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"
}

Impressions recorded.

Media typeapplication/json
object

Example

{}

Authentication or validation error. The handler’s own checks answer with an error property; validation and authentication answer with message.

Media typeapplication/json
One of:
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Examples

{
"error": "One of profileId or deviceId is required"
}

The domain is disabled.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "Domain is disabled. Please reach out to support@releva.ai to enable it."
}

Unexpected server error.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "An internal error occurred."
}