Report that blocks were seen (access token in the header)
- Path
/impressions- Auth
- Access token · browser or app
const url = 'https://releva.ai/api/v0/impressions';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"banners":[{"token":"7e5c8e4b-1f2d-4c3a-9b8e-2a1d3f4e5c6b","bannerId":"1","segmentId":"3"}],"deviceId":"demo-device-pb-1","sessionId":"demo-session-pb-1","url":"https://demo-store.example.com/"}'};
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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "banners": [ { "token": "7e5c8e4b-1f2d-4c3a-9b8e-2a1d3f4e5c6b", "bannerId": "1", "segmentId": "3" } ], "deviceId": "demo-device-pb-1", "sessionId": "demo-session-pb-1", "url": "https://demo-store.example.com/" }'The same call as POST /impressions/{accessToken}, with the access token sent as
authorization: Bearer <accessToken> instead of in the path. When both are sent, the header wins.
Records one recommenderImpression (or bannerImpression) event per item; the request body, the answers and
the errors are the same as on the path form.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”At least one of recommenders or banners, and at least one of profileId or deviceId.
object
object
object
Example
{ "banners": [ { "token": "7e5c8e4b-1f2d-4c3a-9b8e-2a1d3f4e5c6b", "bannerId": "1", "segmentId": "3" } ], "deviceId": "demo-device-pb-1", "sessionId": "demo-session-pb-1", "url": "https://demo-store.example.com/"}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": "Authorization header is malformed. It should look like `Bearer <string>`."}{ "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."}