Banners
Use these methods to manage banners configured in the Back Office as well as create new ones.
GET[host]/api/v2/banners |
|
GET[host]/v2/banners/{bannerId} |
|
POST[host]/v2/banners |
|
PUT[host]/v2/banners/{bannerId} PATCH[host]/v2/banners/{bannerId} |
|
DELETE[host]/v2/banners/{bannerId} |
Get a list of banners
Use this method to obtain a list of banners configured in the Back Office.
To obtain detailed information about a specific banner, use a separate method to get banner details.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
The following filter parameter is available for this method:
- enabled
If
true
, a banner is displayed to clients in the B2Core UI or mobile app; otherwise,false
.
The following sorting parameters are available for this method:
- createTime
The date and time when a banner was created.
- priority
The order in which banners are displayed in the B2Core UI or mobile app if more than one banner is configured.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/banners
curl --location -g --request GET 'https://host.name/api/v2/banners?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[enabled]=true' \
--header 'Authorization: Bearer <token>'
Response
A response contains an array of Banner objects providing information about the banners that correspond to the query parameters included in the request.
Get banner details
Use this method to obtain detailed information about a specified banner.
To obtain a list of all banners created in the Back Office, use a separate method to get a list of banners.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- bannerId required
The identifier of a banner.
GET[host]/v2/banners/{bannerId}
curl --location --request GET 'https://host.name/api/v2/banners/1' \
--header 'Authorization: Bearer <token>'
Response
A response contains a Banner object providing information about a specified banner.
Create a new banner
Use this method to create a new banner.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
Specify the following parameters for a banner:
- caption string required
The banner title.
- url string required
The URL tail defining a page on which a banner is displayed in the B2Core UI or mobile app (for example,
/dashboard
or/wallet
).- priority integer required
The order in which banners are displayed in the B2Core UI or mobile app if more than one banner is configured.
- type integer required
The banner type. Possible values:
desktop
— banners of this type are displayed only in the B2Core UI.mobile
— banners of this type are displayed only in the mobile app.
POST[host]/v2/banners
curl --location --request POST 'https://host.name/api/v2/banners' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"caption": "caption",
"url": "https://example.com/image.png",
"priority": 1,
"type": "desktop"
}'
Response
A response includes a Banner object providing information about the created banner.
Update a banner
Use this method to update a specified banner.
Note
Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- bannerId required
The identifier of a banner.
Body:
The following field values can be updated for a specified banner:
- buttonLink string
The link to an external resource that is opened upon clicking a button displayed on a banner.
- captionLight string
The banner title specified for the light theme.
- captionDark string
The banner title specified for the dark theme.
- enabled boolean
If
true
, a banner is displayed to clients in the B2Core UI; otherwise,false
.- textLight string
The text of a banner specified for the light theme.
- textDark string
The text of a banner specified for the dark theme.
- backgroundLinkLight string
The link to an image that is used as a background image for the light theme.
- backgroundLinkDark string
The link to an image that is used as a background image for the dark theme.
- priority integer
The order in which banners are displayed in the B2Core UI if more than one banner is configured.
- buttonLight string
The button caption specified for the light theme.
- buttonDark string
The button caption specified for the dark theme.
- enabled boolean
If
true
, a banner is displayed to clients in the mobile app; otherwise,false
.- mobileTitle string
The banner title.
- mobileSubTitle string
The banner subtitle.
- mobileText string
The banner text.
- mobileButtonTitle string
The caption of a button displayed on a banner.
- verticalAlign string
The vertical alignment applied to both a banner title and subtitle. Possible values:
middle
top
buttom
- horizontalAlign string
The horizontal alignment applied to both a banner title and subtitle. Possible values:
left
center
right
- padding string
A number of points indicating the padding area for all four sides of a text block.
- imageUrlLight string
The link to an image that is used as a background image for the light theme.
- imageUrlDark string
The link to an image that is used as a background image for the dark theme.
- buttonLink string
The link to an external resource that is opened upon clicking a button displayed on a banner.
- previewEnabled boolean
If
true
, a banner preview is available to clients in the mobile app; otherwise,false
.- priority integer
The order in which banners are displayed in the mobile app if more than one banner is configured.
PUT[host]/v2/banners/{bannerId}
curl --location --request PUT 'https://host.name/api/v2/banners/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"buttonLink": "https://example.com/image.png",
"captionLight": "Banner Title Light",
"captionDark": "Caption Dark",
"enabled": true,
"textLight": "Text Light",
"textDark": "Text Dark",
"backgroundLinkLight": "https://example.com/image.png",
"backgroundLinkDark": "https://example.com/image.png",
"priority": 1,
"buttonLight": "Button caption Light",
"buttonDark": "Button caption Dark",
"type": "desktop"
}'
Response
A response includes a Banner object providing information about the banner that was updated.
Delete a banner
Use this method to delete a specified banner.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- bannerId required
The identifier of a banner.
DELETE[host]/v2/banners/{bannerId}
curl --location --request DELETE 'https://host.name/api/v2/banners/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.