Displaying Campaigns
Every other endpoint in this section is called by your team, from your backend, authenticated as a Drive dashboard user. The Banner Widget is the one exception - it's designed to be called from your customer-facing app, on behalf of the specific customer viewing it, so it authenticates differently.
Different auth: read this before you integrate. This endpoint uses
X-Customer-IDandX-Customer-Secretheaders, not theX-Org-ID/X-App-ID/X-Drive-User-IDdashboard-user credentials every other Drive endpoint uses. If you're used to Drive's other endpoints, this is the one place that pattern changes.
GET /drive-api/v1/campaigns/banner-widgets?channel=webReturns the active campaign banners that customer is eligible for, with content variables already resolved:
{
"data": [
{
"campaign_id": "b28efd2c-5a58-42cd-bed7-5564eb877ca7",
"headline": "Hello {{ customer_name }} - want better insurance?",
"message": "You earn {{ mean_income }} - we can get you some better insurance!",
"template_variables": { "customer_name": "Jim", "mean_income": "10000" },
"primary_button": { "text": "Click here!", "url": "https://thisisbud.com/click-here" },
"secondary_button": { "text": "Or here!", "url": "https://thisisbud.com/or-here" },
"styling": { "type": "brand" },
"priority_order": 0
}
]
}Render headline and message after substituting template_variables, order multiple banners by priority_order, and wire the buttons to their urls. This is the one Drive endpoint meant to sit behind your app's UI rather than your ops dashboard - see Setup your Customers if you haven't already issued customer credentials.
Updated about 22 hours ago

