Widgets API
The widgets API provides a uniform read-only access to canvas items regardless of their type.
List Widgets
Gets all widgets of the specified canvas.
GET /canvases/:id/widgets
Attribute Type Required Description
id (path) uuid yes ID of the canvas
subscribe (query) boolean no See api_streaming
curl -H "Private-Token: <access token>" https://canvus.example.com/api/v1/canvases/3ad9ece4-28be-4e19-9f9a-1a01a4dbae28/widgets
Example response:
[
{
"depth": 0,
"id": "eab4c3da-0fc3-46f2-a7a7-bf9d16494348",
"location": {
"x": 0,
"y": 0
},
"parent_id": "",
"pinned": false,
"scale": 1,
"size": {
"height": 5400,
"width": 9600
},
"state": "normal",
"widget_type": "SharedCanvas"
},
{
"depth": 0,
"hash": "cbcb439a796b",
"id": "2a59b935-02b6-47dc-820c-caab1de64247",
"location": {
"x": 5291.89892578125,
"y": 2564.220703125
},
"original_filename": "",
"parent_id": "eab4c3da-0fc3-46f2-a7a7-bf9d16494348",
"pinned": false,
"scale": 1,
"size": {
"height": 100,
"width": 100
},
"state": "normal",
"title": "A dog",
"widget_type": "Image"
},
{
"background_color": "#ffffff",
"depth": 0,
"id": "dc3ca5b6-0fb4-4628-bf4e-2008087b9430",
"location": {
"x": 5997.61376953125,
"y": 3253.6298828125
},
"parent_id": "eab4c3da-0fc3-46f2-a7a7-bf9d16494348",
"pinned": false,
"scale": 1,
"size": {
"height": 300,
"width": 300
},
"state": "normal",
"text": "",
"widget_type": "Note"
}
]
Single Widget
Gets a single widget.
GET /canvases/:id/widgets/:widget_id
Attribute Type Required Description
id (path) uuid yes ID of the canvas
widget_id (path) uuid yes ID of the item to get
subscribe (query) boolean no See api_streaming
curl -H "Private-Token: <access token>" https://canvus.example.com/api/v1/canvases/3ad9ece4-28be-4e19-9f9a-1a01a4dbae28/widgets/2a59b935-02b6-47dc-820c-caab1de64247
Example response:
{
"depth": 0,
"hash": "cbcb439a796b",
"id": "2a59b935-02b6-47dc-820c-caab1de64247",
"location": {
"x": 5291.89892578125,
"y": 2564.220703125
},
"original_filename": "",
"parent_id": "eab4c3da-0fc3-46f2-a7a7-bf9d16494348",
"pinned": false,
"scale": 1,
"size": {
"height": 100,
"width": 100
},
"state": "normal",
"title": "A dog",
"widget_type": "Image"
}