Skip to main content

Get a brand page block

POST /v2/ian/bp_block

Retrieves a block of content to display within a brand page. Content can be anything the advertiser wants to display on the page, such as additional banners or lists of products. Send one block_versioned_id per request in the order in which the ids appeared in the ordered_versioned_block_ids array returned by the Get a brand page endpoint.

Security

NameInDescription
AuthorizationheaderThe Authorization header with the bearer token acquired during authentication.

Parameters

NameInTypeRequiredDescription
X-Retailer-IdheaderstringOptionalThe retailer slug. This is only required for a retailer with multiple banners. Retailers with single banners can leave this empty.

Request

FieldTypeRequiredDescription
slugstringRequiredThe slug of brand page.
page_view_idstringRequiredIdentifier associated with the page view. Must be a UUID (Universal Unique Identifier).
block_versioned_idBlockVersionedIdRequiredVersioned identifier of the block.
session_contextSessionContextRequiredContext related to user session.
store_contextStoreContextRequiredContext related to the selected store.

BlockVersionedId Object

FieldTypeRequiredDescription
typestringOptionalType of the brand page block.
versioned_identifierVersionedIdOptionalVersioned identifier of the block.

VersionedId Object

FieldTypeRequiredDescription
gidstringOptionalUnique ID of the entity.
versionintegerOptionalVersion of the entity.

SessionContext Object

FieldTypeRequiredDescription
user_idstringRequiredUnique user ID of the user performing the query. Maximum 50 characters.
user_ipstringRequiredThe IP address of the end user. Maximum 50 characters.
user_agentstringRequiredThe user agent of the device making the request. Maximum 50 characters.
test_onlybooleanOptionalWhen true, the campaigns created for Carrot Ads testing are guaranteed to participate in the ads auction along with other campaigns. Default is false.

StoreContext Object

FieldTypeRequiredDescription
location_codestringRequiredThe store location code used to perform the query. Maximum 100 characters.

Request examples

curl --request POST \
--url https://connect-ian.instacart.com/v2/ian/bp_block \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Retailer-Id: string' \
--data '{
"slug": "string",
"page_view_id": "string",
"block_versioned_id": {
"type": "HERO_BANNER",
"versioned_identifier": {
"gid": "string",
"version": 1
}
},
"session_context": {
"user_id": "string",
"user_ip": "string",
"user_agent": "string",
"test_only": true
},
"store_context": {
"location_code": "string"
}
}'

Response

FieldTypeRequiredDescription
brand_page_blockBlockOptionalContent for brand page block.

Block Object

FieldTypeRequiredDescription
bannerBannerOptionalBrand page banner block. May be a section banner or an image story banner with title and text. One of the blocks in this table is returned per brand page block.
item_listItemListOptionalBrand page item list block. May be a standard item list or a spotlight item list with included spotlight item images. One of the blocks in this table is returned per brand page block.
FieldTypeRequiredDescription
titlestringOptionalThe title of the brand page banner. Only applicable for image story banner.
textstringOptionalThe text of the brand page banner. Only applicable for image story banner.
desktop_imageImageMediumPropertiesRequiredThe desktop banner image.
mobile_imageImageMediumPropertiesOptionalThe mobile banner image.

ImageMediumProperties Object

FieldTypeRequiredDescription
public_urlstringRequiredPublic URL that a client must use for rendering. This URL uses the https:// scheme.
alt_textstringOptionalAlternative text to display in case the image fails loading.
image_metadataImageMetadataOptionalAdditional information about the image. This can be used to assist rendering, where needed.

ImageMetadata Object

FieldTypeRequiredDescription
widthintegerOptionalWidth of the image.
heightintegerOptionalHeight of the image.
size_bytesintegerOptionalSize of the image.
content_typestringOptionalMIME-type of the image.

ItemList Object

FieldTypeRequiredDescription
titlestringRequiredThe title of the item list.
product_idsArray(integer)RequiredThe product ids of the item list.
rrcsArray(string)RequiredThe rrcs of the item list.
spotlight_itemsArray(SpotlightItem)OptionalOnly included for spotlight item lists, which will have optional advertiser-provided images.

SpotlightItem Object

FieldTypeRequiredDescription
product_idintegerRequiredThe product ID of the spotlight item.
rrcstringRequiredRetailer reference code (RRC) of the spotlight item.
desktop_imageImageMediumPropertiesOptionalOptional spotlight item image used for desktop. If an image is not returned, fall back to using the default image instead.
mobile_imageImageMediumPropertiesOptionalOptional spotlight item image used for mobile. If an image is not returned, fall back to using the default image instead.

Response examples

200 Success

{
"brand_page_block": {
"banner": {
"title": "mock title!",
"text": "mock text",
"desktop_image": {
"public_url": "https://display.instacart.dev/cdn-cgi/image.png",
"alt_text": "Awesome alt text!"
}
}
}
}

4XX Errors

Error responses return either a single error or multiple errors.

HTTP CodeCauseError MessageError CodeError Meta
400Request with invalid block type"is not included in the list"1001{"key":"block_versioned_id.type"}
400Missing slug"can't be blank"1001{"key":"slug"}
400Missing page view id"can't be blank"1001{"key":"page_view_id"}
400Invalid page view ID"must be a UUID or 'None'"1001{"key":"page_view_id"}
400too long user_id in the session context"User ID length must be less than 51 characters"1001{"key":"session_context.user_id"}
400too long location code in the store context"Location code length must be less than 101 characters"1001{"key":"store_context.location_code"}