读取画布
GET /canvas/v1/canvases/{canvas_id}
Inspect the current canvas before editing, like Pencil get_app_state. The response adds top-level node summaries in canvas order and reusable component ids to the canvas metadata. Use these ids in nodes.list, images.list or an execute script; use the returned version as expected_version to detect concurrent edits. Read full node content with nodes.list rather than guessing fields from these summaries.
支持状态: supported
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| canvas_id | path | string | true | Canvas id returned by create or list, in the form cvs_ followed by 16 lowercase letters or digits; a display name is not accepted. |
响应
HTTP 200
Current canvas metadata, top-level frame summaries and reusable components.
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Assigned canvas identifier, cvs_ followed by 16 lowercase letters or digits; reuse it as canvas_id in subsequent requests. |
| object | string | Resource discriminator; canvas identifies a design canvas. |
| name | string | Display name supplied at creation; defaults to Untitled if omitted and is not an API identifier. |
| version | string | Current revision as a decimal string, incremented by one after each successful write; pass it as expected_version to guard a subsequent execute call. |
| page_count | integer | Number of visible top-level frames in this canvas; hidden frames do not contribute. |
| node_count | integer | Total number of design nodes currently in the canvas. |
| created_at | string | ISO 8601 timestamp recording when this canvas was created. |
| updated_at | string | ISO 8601 timestamp of the latest canvas update; list orders canvases newest first by this value. |
| viewer_url | string | Console URL where a person can watch this canvas update live; open it to review drawing results. |
| collection_id | string | null | Collection id from collections.list, or null for an uncategorized canvas; a canvas belongs to at most one collection. |
| library | null | object | The canvas's latest published library version, or null when it has never been published as a library. |
| library.version | string | Latest published library version, counting from 1. |
| library.published_at | string | ISO 8601 time at which that version was published. |
| imports | array<object> | Libraries this canvas imports, by alias; present on retrieve and list, absent where only the canvas is named (create, update). |
| imports[].alias | string | The alias this library is imported under; components are referenced as alias:component_id and variables as $alias:name. |
| imports[].library | string | The library's canvas id. |
| imports[].name | string | The library's current name, or the name it had when imported if the library canvas was deleted. |
| imports[].version | string | The library version this canvas uses. |
| imports[].latest_version | string | null | The library's newest published version, or null when the library canvas was deleted. |
| imports[].status | string | current means this canvas uses the newest version; outdated means a newer one exists (move the alias with imports.create); deleted means the library canvas is gone, and the imported version keeps rendering. |
| imports[].instances | object | Present on retrieve only. How many nodes of this canvas instantiate each component, keyed by component id without the alias, including instances inside replaced subtrees; a component with no instance is absent. |
| frames | array<object> | Summaries of top-level nodes in canvas order; use their ids to read full node documents or render images. |
| frames[].id | string | Top-level node identifier; use in nodes.list, images.list or an execute script. |
| frames[].name | string | null | Human-readable node name, or null if no name is assigned. |
| frames[].type | string | Pencil node kind for this top-level item, such as frame or group; read nodes.list for its full content. |
| frames[].x | number | Horizontal position of the top-level node on the canvas, in design pixels. |
| frames[].y | number | Vertical position of the top-level node on the canvas, in design pixels. |
| frames[].width | number | Current width of the top-level node in design pixels. |
| frames[].height | number | Current height of the top-level node in design pixels. |
| frames[].node_count | integer | Number of design nodes in this top-level node's subtree. |
| frames[].component | boolean | Whether this top-level node defines a reusable component. |
| frames[].placeholder | boolean | Whether this top-level node is a placeholder awaiting design content. |
| frames[].visible | boolean | Whether this top-level node is visible on the canvas. |
| components | array<object> | Reusable components in this canvas; use their ids when inspecting or referencing component designs. |
| components[].id | string | Node identifier of the reusable component; usable in node reads and script references. |
| components[].name | string | Display name of the reusable component for choosing which design to reuse. |