Sign in to see your venue's slug and publishable key in every sample.
Your account has no venue yet, so the samples keep their placeholders. Sign out
Signed in as · . Create a publishable key in the console and reload to see it here. Sign out
Signed in as · . The samples show your venue's publishable key. Sign out
Developer docs
Highlights
Read the highlight cards a venue shows on its website — image, title, short text and an optional link to a menu item, event, voucher offer or page.
The highlight cards a venue curates for its website: a picture with a title, a short text and, optionally, a link to a menu item, an event, a gift-voucher offer or any other page. They are their own content type, separate from specials: a highlight has no price, weekdays or time window, only a first and a last day it is shown. Only published cards inside that range appear. It follows the same key rules as the rest of /api/venues/** (Keys and headers), is open to every plan, and answers 404 with a problem body when no venue has that slug.
Endpoints
GET /api/venues/{venueSlug}/highlights
Takes no query parameters: the answer is always the cards that are visible today in the venue's time zone.
Response 200 OK
| Field | Type | Meaning |
|---|---|---|
slug |
string | The venue |
timezone |
string | IANA id of the venue's time zone; the visibility range is judged in it |
highlights[] |
object[] | The visible cards in display order; the list can be empty |
Each entry in highlights[]:
| Field | Type | Meaning |
|---|---|---|
id |
string | The card's id |
title |
string | The headline |
text |
string | An optional short text (nullable) |
imageUrl |
string | The card's picture |
linkKind |
string | What the card links to: None, MenuItem, Event, VoucherProduct or External |
linkTarget |
string | The menu item's id, the event's slug, the voucher offer's id or the external URL, depending on linkKind (nullable) |
linkUrl |
string | The absolute https URL of an External link; null for every other kind (nullable) |
Cards are ordered by the operator's sort order, then by title.
Links
A card links to one of four things, or to nothing:
External— a completehttpsURL, ready to use inlinkUrl.Event,MenuItemandVoucherProduct— a reference bylinkTarget. The API does not know where events, menu items or the voucher shop live on your site, so you build the address yourself, for example/events/plus the slug.renderHighlightstakes a URL template for each of them.
A reference is checked when the card is saved and again on every read. If the event is no longer published, the menu item was deleted or the voucher offer was retired, the card is still returned, but as linkKind: "None" with no linkTarget, so a link never dangles.
Visibility and the time zone
An operator sets an optional first and last day for each card, as calendar days in the venue's own time zone, both inclusive. The card shows on every day in that range. Without a first day it is shown from the moment it is published; without a last day, until it is unpublished or deleted. "Today" is the venue's today, never the caller's: a request at 23:30 UTC in winter is already tomorrow for a venue in Berlin, and a card whose last day was yesterday is gone.
A response for demo-sportsbar could look like this:
{
"slug": "demo-sportsbar",
"timezone": "Europe/Berlin",
"highlights": [
{
"id": "7c1f0a2be9d44c3a8b5e6d7f8a9b0c11",
"title": "Derby night",
"text": "Every goal on the big screen, with a pitcher of beer for the table.",
"imageUrl": "https://cdn.bookdineplay.com/media/demo-sportsbar/01JD3Z8Q6V5T2N4M7K9R1S0XYA.webp",
"linkKind": "Event",
"linkTarget": "derby-night",
"linkUrl": null
},
{
"id": "7c1f0a2be9d44c3a8b5e6d7f8a9b0c12",
"title": "Our new autumn menu",
"text": null,
"imageUrl": "https://cdn.bookdineplay.com/media/demo-sportsbar/01JD3Z8Q6V5T2N4M7K9R1S0XYB.webp",
"linkKind": "External",
"linkTarget": "https://example.com/autumn-menu.pdf",
"linkUrl": "https://example.com/autumn-menu.pdf"
}
]
}Errors
401— no key, or an unknown one.403— the key belongs to another venue, a publishable key was sent from an origin that is not on its allowlist, or a publishable key was sent without anOriginheader. See What the API refuses.404— no venue with that slug.
curl
curl "https://api.bookdineplay.com/api/venues/your-venue/highlights" \
-H "X-BookDinePlay-Key: bdp_pk_your_publishable_key" \
-H "Origin: https://www.your-venue.example"JavaScript
const client = BookDinePlay.createClient({
apiBaseUrl: 'https://api.bookdineplay.com', venueSlug: 'your-venue', publishableKey: 'bdp_pk_your_publishable_key'
});
const response = await client.highlights(); // null when the venue is unknown
for (const card of response?.highlights ?? []) {
console.log(card.title, card.linkKind, card.linkTarget);
}C#
// `client` is the IBookDinePlayClient from AddBookDinePlayClient, registered with the venue's SECRET key
// read from configuration (builder.Configuration["BookDinePlay:ApiKey"]). A server sends no Origin header.
var response = await client.GetHighlightsAsync("your-venue", cancellationToken);
foreach (var card in response?.Highlights ?? [])
{
Console.WriteLine($"{card.Title} ({card.LinkKind}: {card.LinkTarget})");
}PHP
<?php
// Server-side: the secret key is a constant in wp-config.php, never in a template or in JavaScript.
$response = wp_remote_get( 'https://api.bookdineplay.com/api/venues/your-venue/highlights', [ 'headers' => [ 'X-BookDinePlay-Key' => BOOKDINEPLAY_SECRET_KEY ] ] );
$response = json_decode( wp_remote_retrieve_body( $response ), true );
foreach ( $response['highlights'] ?? [] as $card ) {
echo "{$card['title']} ({$card['linkKind']}: {$card['linkTarget']})
";
}The JavaScript sample uses the publishable key. The C# sample runs on a server, so it uses a secret key (bdp_sk_…) read from configuration and sends no Origin header; never ship a secret key to a browser. client.highlights and GetHighlightsAsync both answer null for an unknown venue, where the plain HTTP call is a 404. renderHighlights draws the same data without any code of your own.
Operator: saving highlights
Operators manage highlights through the operator API (bearer token of the venue's operator), not through the public /api/venues/** surface: GET, POST, PUT and DELETE on /api/operator/venue/highlights. A PUT is a full replace, so always send status and linkKind: an omitted status binds to Draft and unpublishes the card, an omitted linkKind to None, and an omitted visibleFrom or visibleTo removes that bound. A venue holds at most 30 highlights; the 31st is refused with 409. The picture is uploaded first with a POST to /api/operator/venue/menus/media, which returns the address to send as imageUrl. Highlights are open to every plan and are removed with DELETE, not archived.
Next steps
- Venue — the other seven reads for this venue.
- Specials — the daily dishes and deals, a separate content type.
- JavaScript highlights — the widget that renders these cards.