Skip to main content

API Responses

Integration Recommendations

When integrating the API on an advertising platform, it must be remembered that a call to an external API can always end unsuccessfully. There are many reasons for this - network infrastructure instability, Roskomnadzor blocks, server-side errors, or simply human factor. Therefore, we recommend considering the possibility of receiving a non-standard response and working this out from the perspective of the website or mobile application's appearance. This is especially important for the home page - if the promo material takes up a large part of the screen, then perhaps filling this space with default content should be provided.

It is mandatory to set some reasonable timeout on all external requests to maintain interface responsiveness.

Also, do not forget that receiving empty promo material (response 204) is a completely standard and frequent situation that occurs if no campaign is launched for the requested user segment.

It is worth providing for the possibility that the request result may have an unexpected format. Campaigns can provide different content variants presented in different forms. These can be banners, product shelves, branded product shelves, etc. Each content variant will have its own logic for rendering and tracking the fact of viewing. Variants of this content are always limited by the acceptContent parameter, which guarantees the predictability of the request result, however, a general practice is to provide for and handle unknown content format.

🚧 ORD (Advertising Data Operator)

If a campaign with content type Banners / SharedBanners is launched in a jurisdiction where the advertising law is in force, then as a result of the ad request, information about the legal entities that are the authors of the creatives (eridToken, advertiserLegalName, advertiserInn, advertiserOgrn) is returned.

Impression

Contains data for displaying sponsored content. Can take different forms depending on the value passed in the acceptContent request.

acceptContent values:

  • string
  • productIds
  • banners
  • sharedBanners
  • sharedProductIds

StringImpression

Field NameRequiredTypeDescription
idYesstringIdentifier of the requested impression
contentTypeYesstringContent type. Always equal to string
contentYesStringImpressionContentContent for display

StringImpressionContent

String content for display

Field NameRequiredTypeDescription
idYesstringContent identifier
stringYesstringArbitrary text

Examples

An object of type Impression with a content field of type "string".

{
"id": "impression identifier",
"contentType": "string",
"content": {
"id": "content identifier",
"string": "any string"
}
}

ProductIdsImpression

Field NameRequiredTypeDescription
idYesstringIdentifier of the requested impression
contentTypeYesstringContent type. Always equal to productIds
contentYesProductIdsImpressionContentContent for display

ProductIdsImpressionContent

Content for displaying a product shelf

Field NameRequiredTypeDescription
idYesstringContent identifier
productIdsYesnumber arrayArray of product identifiers for playback

Examples

An object of type Impression with a content field of type "product shelf".

{
"id": "impression identifier",
"contentType": "productIds",
"content": {
"id": "content identifier",
"productIds": [123, 321]
}
}

BannersImpression

Field NameRequiredTypeDescription
idYesstringIdentifier of the requested impression
contentTypeYesstringContent type. Always equal to banners
contentYesBannersImpressionContentContent for display

BannersImpressionContent

Content for banner display

Field NameRequiredTypeDescription
idYesstringContent identifier
bannersYesBanner arrayArray of banners for display
ordNoobjectObject with information for ORD

Ord

Field NameRequiredTypeDescription
eridTokenYesstringERID token
advertiserLegalNameYesstringLegal entity
advertiserInnYesstringTIN
advertiserOgrnYesstringPSRN

Banner information

Field NameRequiredTypeDescription
targetUrlNostringURL to navigate to when clicking the banner
pictureURlYesstringImage URL

Examples

An object of type Impression with a content field of type "banners".

{
"id": "impression identifier",
"contentType": "banners",
"content": {
"id": "content identifier",
"banners": [
{
"targetUrl" : "http://host/path",
"pictureUrl": "http://host/path/image.png"
}
],
"ord": {
"eridToken": "<erid token>",
"advertiser": {
"legalName": "<legal name>",
"inn": "<inn>",
"ogrn": "<ogrn>"
}
}
}

SharedBannersImpression

Content for displaying shared banners. Differs from BannersImpression in that banners from different advertisers can be present here.

Field NameRequiredTypeDescription
idYesstringIdentifier of the requested impression
contentTypeYesstringContent type. Always equal to sharedBanners
contentYesBannersImpressionContent arrayContent for display

BannerImpressionContent

Content for banner display

Field NameRequiredTypeDescription
idYesstringContent identifier
bannerYesBannerBanner for display
ordNoobjectObject with information for ORD

Ord

Field NameRequiredTypeDescription
eridTokenYesstringERID token
advertiserLegalNameYesstringLegal entity
advertiserInnYesstringTIN
advertiserOgrnYesstringPSRN

Examples

An object of type Impression with a content field of type "shared banners".

{
"id": "impression identifier",
"contentType": "sharedBanners",
"content": [
{
"id": "content identifier",
"banner": {
"targetUrl" : "http://host/path",
"pictureUrl": "http://host/path/image.png"
},
"ord": {
"eridToken": "<erid token>",
"advertiser": {
"legalName": "<legal name>",
"inn": "<inn>",
"ogrn": "<ogrn>"
}
}
},
{
"id": "content identifier",
"banner": {
"targetUrl" : "http://host/path",
"pictureUrl": "http://host/path/image.png"
},
"ord": {
"eridToken": "<erid token>",
"advertiser": {
"legalName": "<legal name>",
"inn": "<inn>",
"ogrn": "<ogrn>"
}
}
}
]
}

SharedProductIdsImpression

Content for displaying products from different advertising campaigns. Differs from ProductIdsImpression in that shelves of different advertisers can be present here.

Field NameRequiredTypeDescription
idYesstringIdentifier of the requested impression
contentTypeYesstringContent type. Always equal to SharedProductIds
contentYesProductIdsImpressionContent arrayContent for display

ProductIdsImpressionContent

Content for displaying a product shelf

Field NameRequiredTypeDescription
idYesstringContent identifier
productIdsYesnumber arrayArray of product identifiers for playback

Examples

An object of type Impression with a content field of type "shared products".

{
"id": "impression identifier",
"contentType": "SharedProductIds",
"content": [
{
"id": "content identifier",
"productIds": [345]
},
{
"id": "content identifier",
"productIds": [123]
}
]
}