Overview
With the Canvases API, you can:- Create new canvases
- List existing canvases
- Retrieve canvas details
- Update canvas content
- Delete canvases
List Canvases
Retrieve all canvases with pagination and filtering:data.data of the answer, next to page, size and total.
Filtering Canvases
Filter canvases by various criteria:updatedBefore. The list cannot be filtered by persistence key.
Get Canvas by ID
Retrieve a specific canvas:Create Canvas
Create a new canvas:One Widget to a Canvas
A canvas holds one widget at a time. A new canvas is empty. Its widget is made withPOST /widgets, naming the canvas in canvasId; a widget made without a canvas gets a canvas of its own. Naming a canvas that already has a widget is refused with 409 and the code CANVAS_ALREADY_HAS_WIDGET, and nothing is created (see Where a Widget Can Go). primaryWidgetId on the canvas is the widget it holds, or null while it has none.
Update Canvas
Update an existing canvas:Delete Canvas
Delete a canvas. Its widget is deleted with it:Canvas Structure
A canvas in an answer carries these fields:
An answer can carry other fields. They are for Widgetic’s own apps and can change without notice, so read only the ones above.
Canvas Content
ThecanvasContent field stores the canvas state. It holds JSON of your choosing: the API saves what you send and does not check its shape. The examples above use this shape:
canvasContent as a whole, so send all of it.
Persistence Keys
Use persistence keys to maintain references between your application and Widgetic:id that creation returns in your own records.
Related Endpoints
Next Steps
Widgets
Make the widget of a canvas
Compositions
Set a widget up for one place and embed it