SDKs & Sample Apps
...
SDKs
Console SDK

Console Banner API

29min

Overview

The Console Banner feature allows platform and product admins to create and manage banners that inform the app users about important notifications, scheduled maintenance, or downtimes directly within the console. Once configured, banners display in real-time, ensuring that all relevant users are informed. Banner can be created for the different level types:

  • Stack Level: For core platform-wide activities (e.g., system-wide maintenance). 
  • Tenant Level: For tenant-specific updates (e.g., customer-specific reminders).
  • Solution Level: For specific solutions like DispatchOne or TMS (e.g., scheduled downtime for a particular solution).

Info: To learn more about the usage and implementation of these banners, refer to the JSON Examples section at the bottom of this page.

Accessing the Banner API

To access the banner feature, platform/product admins must have the appropriate permissions. If you do not have admin access, reach out to us by visiting the developer portal at https://portal.os1.delhivery.com/ and click the Contact Us button to request access.

Once you have admin access, follow the steps below to start using the Banner API.

Prerequisites

  • User Role: Ensure you have the Product Admin role to access the banner creation API.
  • API Access: All Banner API requests require a valid access token to ensure only authorized users (product admins and support users) can create, update, or delete banners. Refer to the Get Access Token section and get your access token.

API Configuration

The Banner API allows product admins to create, update, and delete banners for their applications. The below section outlines how to use the API, including the endpoints, request parameters, and sample example code snippets.

Configuration Parameters

This table outlines the parameters used in the Banner API requests, including headers, query parameters, and path parameters.

Parameter

Data Type

Description

Required

x-developerplatform-access

string

Access token for authentication.

Yes

levelType

string

Type of the level at which the banner is applicable (e.g., stack).

Yes

solutionId

string

ID of the solution.

No

bannerId

string

Universal Unique identifier for the banner (used for updating and deleting)

Yes

activityDate

string

Date of the banner display (in YYYY-MM-DD format).

Yes

activeFromTime

string

Start time for banner display (ISO 8601 format)

Yes

activeUntilTime

string

End time for banner display (ISO 8601 format)

Yes

activityStartTime

string

The exact start time of the activity that the banner is notifying users about (in ISO 8601 format).

Yes

activityEndTime

string

The exact end time of the activity that the banner is notifying users about (in ISO 8601 format).

Yes

title

string

The title of the banner.

Yes

message

string

The main message of the banner.

Yes

data

Object

Key-value pairs for dynamic content in message.

Yes

Creating a Banner

1. Register a Banner (POST)

Register a new banner using the Banner API. Make sure all required fields are valid and that you have the necessary support access with the provided access token.

To register a banner, send a POST request using the endpoint below:

JS


When making requests to the Banner API, include the following header and parameters:

Request Header

All requests to the Banner API must include the following header:

X-developerplatform-access: This is the access token used for authentication.

Request Parameters

Parameter

Description

Required

x-developer platform-access

Access token for authentication. (mandatory).

Yes

orgId

Unique identifier of the user’s organization.

Yes

Sample Request

JS

Note: Ensure the activityStartTime and activityEndTime fall within the activeFromTime and activeUntilTime. Additionally, banners cannot be created for any past date or time.

Sample Response

JS


2. Get All Banners (GET)

Retrieve a list of banners for a specific level using the GET method. This allows you to fetch active banners for a particular level on the current day.

To get the specific bannerID, send the GET request using the following endpoint:

JS


Request Parameters

Parameter

Description



x-developer platform-access

Access token for authentication. (header).

Yes

levelType

Specifies the type of level for which banners are requested. Must be one of: stack, tenant, or solution.

Ye

Query Parameter:

  • levelType: Type of the level for which banners are requested.

Sample Response

JS


In this example, levelType is the query parameter being used to filter the results returned by the API.

3. Get Banner by ID

Retrieve the details of a specific banner by providing its unique bannerId using the GET method.

JS


Request Parameters

Parameter

Description

Required

x-developer platform-access

Access token for authentication. (mandatory).

Yes

bannerId

Unique identifier for a specific banner.

Yes

Sample Response

JS


4. Update a Banner (PATCH)

Update an existing banner using the PATCH method. This allows you to modify various properties of the banner such as title, content, active times, etc. 

Note: Banner’s levelType and levelIds field cannot be updated. If these attributes need changes, you must delete the banner and create a new one.

To update a banner, send the PATCH request using the following endpoint:

JS


Request Parameters

Parameter

Description

Required

x-developer platform-access

Access token for authentication. (mandatory).

Yes

bannerId

Unique identifier for a specific banner.

Yes

orgID

Unique identifier for the user’s organization.

Yes

Sample Request

JS


Sample Response:

JS


4. Delete a Banner (DELETE)

To delete a banner, send a DELETE request to the appropriate API endpoint with the bannerId of the banner you wish to remove.

JS


Sample Response

JS


Upon successful deletion, the API will delete the specific banner.

JSON Examples

Stack Level Banner

This banner notifies users of a planned maintenance event that affects the core services related to the overall system, applicable to all users in the stack.

JS


Tenant Level Banner 

This banner serves as a payment reminder for a specific tenant to ensure only the relevant users are notified.

JS


Solution Level Banner

This banner is specifically meant for users of the DispatchOne solution, providing them information about when the service will be unavailable due to maintenance.

JS