API Reference
The Boomack Server offers all its capabilities via an HTTP API, loosely following the RESTful style.
The preferred way of interacting with a Boomack Server from you own program, is to use one of the clients. If there is no client for your programming language, or you only want to issue a small number of specific requests, you can use a generic HTTP client in your language, and interact with the server directly.
The complete API is documented with the OpenAPI Specification 3, and visualized in a Swagger viewer:
You can even try out examples directly from the documentation, if you start a local Boomack Server.
boom
is running in the background,
try out the switches --dry
and --curl
.Authentication ↑
By default the Boomack API is not protected by authentication. However, the default configuration is intended for local use only. As soon as the API is reachable by someone else than the person running the Boomack Server, it is highly advised to activate and configure the authentication of the server.
See API Authentication in the server configuration page for more details.
As soon as the authentication of the server is activated,
an API client needs to provide an access token with every API request.
The access token is expected in the HTTP header field Authorization
with the prefix Token␣
.
Authentication Example ↑
If an access token edc3eacdb404143ad12a1eb2e667
is configured,
the access token must be send in the HTTP header of every API request:
Authorization: Token edc3eacdb404143ad12a1eb2e667
To learn how to authenticate with the Boomack Client CLI, takte look at the configuration section of the Boomack Client CLI.
Basically you have the following options:
- Command line switch:
--token edc3eacdb404143ad12a1eb2e667
- Environment variable:
BOOMACK_CLIENT_TOKEN
=edc3eacdb404143ad12a1eb2e667
- Configuration file
A config file for the Boomack CLI can look like this:
server:
url: http://127.0.0.1:3000
client:
token: edc3eacdb404143ad12a1eb2e667
{
"server": { "url": "http://127.0.0.1:3000" },
"client": { "token": "edc3eacdb404143ad12a1eb2e667" }
}
Response Types ↑
Currently Boomack supports the following MIME types in its responses.
Meaning, you can use the following MIME types in the Accept
header field
of your API requests.
application/json
The preferred way for programmatic access to the APItext/plain
Used by the Boomack Client CLI to present the responses in a human friendly waytext/html
Sometimes useful for embedding the response directly into other HTML
Panel Management ↑
The panels and slots are managed by the following API routes.
- GET
/v1/panels
Get the IDs of all existing panels - GET
/v1/panels/{panelId}/layout
Get the layout of a panel - PUT
/v1/panels/{panelId}/layout
Create a new panel or change a panels layout - DELETE
/v1/panels/{panelId}
Delete an existing panel - POST
/v1/panels/{panelId}/clear
Clear a whole panel from content - POST
/v1/panels/{panelId}/slots/{slotId}/clear
Clear a slot from content
For a more detailed explanation please consult the OpenAPI specification.
Panel Layout Structure ↑
The data structure of a panel layout consists of the following properties:
title
: A human friendly name for the panel. Optional, the panel ID is used if empty.style
: A CSS block to include in the HTML header of the panel. Optional.script
: A JavaScript block to include in the HTML header of the panel. Optional.header
: A boolean switch to disable the header region of the panel. Default istrue
.headerSize
: The size of the header:"mini"
,"tiny"
,"small"
,"medium"
,"large"
,"huge"
,"massive"
. Default is"medium"
.headerTools
: A boolean switch to disable the toolbar inside the header region of the Panel. Default istrue
.showLogo
: A boolean switch to disable the logo inside the header region of the Panel. Default istrue
.theme
: The name of a theme. E. g."dark"
. Default is"default"
.themeVariation
: The variation of the theme. Options are"full"
and"slim"
. Default is"full"
.hidden
: A flag to hide the panel from the main menu. Default isfalse
.update
: The update mode for the panel. Options are"always"
,"auto"
,"never"
. Default is"auto"
.
Where"auto"
means, that the panel is updated only, if it is visible to the viewer.defaultSlot
: The ID of the default Slot in this panel. Default is the first Slot inslots
.type
: The layout type:"grid"
or"document"
. Default is"grid"
.slots
: An object with slot IDs as keys and slot definitions as values (see Slot Properties).
Grid Layout Properties
Panel layouts with the type
set to "grid"
, can have the following additional properties:
grid
: An object, describing a grid layout. Optional.zoom
: A scale factor for CSS based scaling of all slots including their toolbars. Default is 1.0.columns
: The number of columns. Default is 1.rows
: The number of rows. Default is 1.noMargin
: A boolean switch to suppress any space around the grid: Default isfalse
.noGap
: A boolean switch to suppress any space between the cells: Default isfalse
.
Document Layout Properties
Panel layouts with the type
set to "document"
, can have the following additional properties:
document
: An object, describing a document layout. Optional.zoom
: A scale factor for CSS based scaling of all slots including their toolbars. Default is 1.0.slotTemplate
: An object with a template for new slots (see Slot Properties).
Slot Properties
A slot in a panel layout is defined with the following properties:
index
: A number, giving a natural order to the slots.history
: The size of the history. Default is 0.extensions
: The maximum number of content extensions in this slot. Default is 100.toolbar
: A boolean switch to disable the toolbar for the slot. Default istrue
for grid layouts andfalse
for document layouts.noPause
: A boolean switch to disable the button for pausing the slot. Default istrue
.noZoom
: A boolean switch to disable the buttons for manual zoom. Default isfalse
.noClear
: A boolean switch to disable the button for clearing the slot. Default isfalse
.noMaximize
: A boolean switch to disable the button for maximizing the slot. Default isfalse
.noSingleOut
: A boolean switch to disable the button for opening the slot in a new tab. Default isfalse
.showId
: A boolean switch to disable the slot ID in the background. Default istrue
for grid layouts andfalse
for document layouts.border
: A boolean switch to remove the border from the slot. Default istrue
.zoom
: A scale factor for CSS based scaling of the slots content. Default is 1.0.colorFilter
: The stringtheme
to tint the slot content with the theme color configuration, a CSS filter string, or an SVG color filter matrix (seefeColorMatrix
) as one dimensional array with 3×4 or 4×5 elements.
Slot properties, only supported in a grid layout:
column
: The zero-based column where the slot starts. Default is 0.row
: The zero-based row where the slot starts. Default is 0.columnSpan
: The number of columns spanned by the slot. Default is 1.rowSpan
: The number of rows spanned by the slot. Default is 1.
Slot properties, only supported in a document layout:
minHeight
: The CSS length for the minimal height of the slot. Default is"0"
.height
: The CSS length for the height of the slot. Default isnull
.maxHeight
: The CSS length for the maximal height of the slot. Default isnull
.
Display Request ↑
A display request delivers hyper media content to the Boomack Server with the intention of displaying it on a panel inside a slot.
A display request is formatted with JSON or YAML and send to the following route:
- POST
/v1/display
Display one or multiple media items (text, URL, or BASE64 encoded BLOB)
One call to the route can contain one single display request as a map or multiple display requests in an array.
A display request has the following structure:
panel
: The target panel. Default:default
.slot
: The target slot. Defaults to the default slot of the panel.title
: An optional title to be displayed in the toolbar of the slot.type
: The media type of the content. Defaults totext/plain
iftext
is used, otherwise required.text
/data
/src
: The hyper media content to display.presets
: An array of preset IDs.options
: a map with display options.
api.request.yaml
is set to true
.
If the option is set to false
only JSON formatted requests are allowed.The content can be transmitted in one of the three properties text
, data
, or src
:
- If the content is Unicode text, then it can simply be put in the
text
property as a string. In this case thetype
property, if omitted, defaults totext/plain
. - Content of any kind can be encoded with BASE64 and put into the property
data
. IN this case thetype
property is required. But, if the content is considerably large, a stream request can avoid the overhead of the BASE64 encoding. - Lastly content can be referenced with an URL in the
src
property. Supported protocols arehttp
,https
, andfile
. The resource must be reachable by the Boomack Server. Therefore, the path in a file URL must exist in the filesystem of the Boomack Server.
Stream Display Request ↑
Stream display requests are HTTP requests to the routes:
- POST
/v1/panels/{panelId}/display
Displays one media item in the default slot of a panel. - POST
/v1/panels/{panelId}/slots/{slotId}/display
Displays one media item in a specific slot.
The media content is transferred as the body of the HTTP request. The target panel and slot are encoded as part of the URL. The other parts of a display request are encoded in HTTP header fields:
Content-Type
: The MIME type of the content with charset fortext/*
types. Is required.Content-Length
: The size of the content in bytes. Advised.X-Boomack-Title
: The URL-encoded title for the media content. Default is none.X-Boomack-Presets
: A comma separated list of preset IDs.X-Boomack-Options
: The display options, serialized as JSON/YAML and optionally encoded with BASE64.
See Stream Display Request on the concepts page for more details.
Evaluation Request ↑
An evaluation is triggered by the following routes:
- POST
/v1/eval
Evaluate one or multiple JavaScript scripts - POST
/v1/panels/{panelId}/eval
Evaluate JavaScript code in a panel
The first route supports JSON or YAML as content type for the body.
It expects either a map with the properties panel
and script
.
Or an array of such maps.
The panel
property must be set to an ID of an existing panel.
If the panel
property is omitted, the panel ID default
is used as default.
The script
property must be set to a string, containing valid JavaScript code.
The second route expects the content type application/javascript
and therefore, the JavaScript code directly as body.
Other than the first route, the second can only trigger the evaluation
of one script text in one target panel.
The ID of the target panel is given as part of the path in the URL.
See Evaluation Request on the concepts page for more details.
Preset Management ↑
Presets are managed with the following routes:
- GET
/v1/presets
Gets the IDs of all existing presets - GET
/v1/presets/{presetId}
Gets an existing preset - PUT
/v1/presets/{presetId}
Creates a new or updates an existing preset - DELETE
/v1/presets/{presetId}
Deletes an existing preset
The PUT route supports JSON and YAML as content type for the body. It expects a single map with display options.
See Preset on the concepts page for more details.
Media Type Management ↑
Media types are managed with the following routes:
- GET
/v1/types
Gets the IDs of all existing media types - GET
/v1/types/{mainType}/{subType}
Gets an existing media type - PUT
/v1/types/{mainType}/{subType}
Creates a new or updates an existing media type - DELETE
/v1/types/{mainType}/{subType}
Deletes an existing media type
The PUT route supports JSON and YAML as content type for the body. It expects a single map with the following properties:
text
: A boolean value indicating, if the media contains text. Defaults totrue
if the main type istext
otherwisefalse
.presets
: An array of preset IDs. Defaults to an empty array.options
: A map with display options. Defaults to an empty map.
See Media Type on the concepts page for more details.
Action Management ↑
Actions are managed with the following routes:
- GET
/v1/actions
Gets the IDs of all existing actions - GET
/v1/actions/{actionId}
Gets an existing action - PUT
/v1/actions/{actionId}
Creates a new or updates an existing action - DELETE
/v1/actions/{actionId}
Deletes an existing action
The PUT route supports JSON and YAML as content type for the body.
It expects a single map with the definition for an action.
The only required property is the type
property with the ID of
an action type.
Additionally supported properties depend on the selected action type.
{
"type": "the action type",
...
}
type: the action type
...
See Action on the concepts page for more details.
Export ↑
Export requests trigger an export of all panels, an individual panel, or an individual slot to the filesystem of the Boomack Server. The following routes allow to trigger the export:
- POST
/v1/panels/export
Export all panels on the server - POST
/v1/panels/{panelId}/export
Export a panel on the server - POST
/v1/panels/{panelId}/slots/{slotId}/export
Export a single slot on the server
The routes expect a JSON or YAML body with a single map, holding the following properties:
theme
: The theme to use for the exported HTML page. Defaults todefault
.zoom
: A floating point number as predefined CSS zoom for the whole page. Defaults to1.0
.path
: A relative path to the target folder. Defaults. to/
.
The path is resolved relative to the base directory for exporting, which is set with the configuration optionexport.local.location
.name
: A name for the target HTML file without the filename extension. Defaults to the ID of the panel or slot.
Is ignored when exporting all panels.
api.enable.export
= true
,
but the export is still deactivated, as long as no base path is set for the export.
The base path is set with the configuration option export.local.location
.See Export on the concepts page for more details.