白板 REST API 参考
构建时从公开白板 API 定义生成:房间、场景、内容、快照、回放与 Token。
分组概览
本页由公开 REST 接口定义在构建时生成:标签 whiteboard,共 22 个操作(全量 22 个)。鉴权、信封与分页约定见 REST API 总览.
| 方法 | 路径 | 摘要 |
|---|---|---|
GET | /v1/whiteboard/rooms | List whiteboard rooms |
POST | /v1/whiteboard/rooms | Create a whiteboard room |
GET | /v1/whiteboard/rooms/{uuid} | Get room information |
PATCH | /v1/whiteboard/rooms/{uuid} | Disable (ban) or re-enable a room |
POST | /v1/whiteboard/rooms/{uuid}/close | Close a room permanently |
POST | /v1/whiteboard/rooms/{uuid}/members | Join a room as a member |
DELETE | /v1/whiteboard/rooms/{uuid}/members/{memberId} | Leave a room |
GET | /v1/whiteboard/rooms/{uuid}/scenes | Get scene path list |
POST | /v1/whiteboard/rooms/{uuid}/scenes | Add scenes |
GET | /v1/whiteboard/rooms/{uuid}/scene-state | Get the current scene state |
PATCH | /v1/whiteboard/rooms/{uuid}/scene-state | Switch the current scene |
POST | /v1/whiteboard/rooms/{uuid}/strokes | Append a stroke |
DELETE | /v1/whiteboard/rooms/{uuid}/strokes/{strokeId} | Erase a stroke |
POST | /v1/whiteboard/rooms/{uuid}/undo | Undo the caller's last operation |
POST | /v1/whiteboard/rooms/{uuid}/redo | Redo the caller's last undone operation |
PUT | /v1/whiteboard/rooms/{uuid}/viewport | Set the room viewport |
POST | /v1/whiteboard/rooms/{uuid}/images | Insert an image |
GET | /v1/whiteboard/rooms/{uuid}/snapshot | Export a room snapshot |
GET | /v1/whiteboard/rooms/{uuid}/snapshot.svg | Render the current scene as SVG |
GET | /v1/whiteboard/rooms/{uuid}/replay | Get the replay timeline |
POST | /v1/whiteboard/tokens/rooms/{uuid} | Generate a room token |
POST | /v1/whiteboard/tokens/teams | Generate a project (SDK) token |
操作详情
GET /v1/whiteboard/rooms
List whiteboard rooms
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
beginUUID | query | string | ||
limit | query | integer | 1..1000,默认 100 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | Room list — array<object> |
401 | Missing or invalid project credentials / room token — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/whiteboard/rooms?beginUUID=value&limit=50" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/whiteboard/rooms
Create a whiteboard room
Creates a room owned by the authenticated project. isRecord is accepted for Agora compatibility and persisted, but server-side recording of whiteboard operations is only exposed through the replay endpoint.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
isRecord | boolean | 默认 false | |
limit | integer | Maximum concurrent writer/admin members; 0 means no limit.;>= 0,默认 0 |
{
"isRecord": true,
"limit": 1
}响应
| 状态码 | 说明 / schema |
|---|---|
201 | Room created — Room |
400 | Invalid parameter — Error |
401 | Missing or invalid project credentials / room token — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/whiteboard/rooms" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"isRecord":true,"limit":1}'GET /v1/whiteboard/rooms/{uuid}
Get room information
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | Room information — Room |
401 | Missing or invalid project credentials / room token — Error |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"PATCH /v1/whiteboard/rooms/{uuid}
Disable (ban) or re-enable a room
Banning removes the room from joinable rooms; re-enabling with isBan: false restores it. Requires the admin role.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
isBan | boolean | 是 |
{
"isBan": true
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | Updated room — Room |
400 | Invalid parameter — Error |
401 | Missing or invalid project credentials / room token — Error |
403 | Token role is insufficient or the room is banned/closed — any |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X PATCH "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"isBan":true}'POST /v1/whiteboard/rooms/{uuid}/close
Close a room permanently
Closing is terminal: the room stays readable for audit and replay but rejects joins, scene mutations and token minting. Requires the admin role.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | Closed room — Room |
401 | Missing or invalid project credentials / room token — Error |
403 | Token role is insufficient or the room is banned/closed — any |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/close" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/whiteboard/rooms/{uuid}/members
Join a room as a member
Registers a member in the room and enforces the room limit for writer/admin members. The member record feeds scene-state.memberStates and the undo/redo stacks.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
memberId | string | 长度 0..64 | |
role | enum(admin | writer | reader) | 默认 "writer" |
{
"memberId": "string",
"role": "admin"
}响应
| 状态码 | 说明 / schema |
|---|---|
201 | Member joined — object{ memberId, role, joinedAt, version } |
400 | Invalid parameter — Error |
401 | Missing or invalid project credentials / room token — Error |
403 | Token role is insufficient or the room is banned/closed — any |
404 | Room, scene or stroke not found — Error |
409 | Operation conflicts with the current room state — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/members" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"memberId":"string","role":"admin"}'DELETE /v1/whiteboard/rooms/{uuid}/members/{memberId}
Leave a room
Marks the member as left and frees a writer slot. Admins may remove other members; writer/reader tokens may only remove themselves.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
memberId | path | 是 | string | 长度 0..64 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | Member left — object{ memberId, leftAt, version } |
401 | Missing or invalid project credentials / room token — Error |
403 | Token role is insufficient or the room is banned/closed — any |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X DELETE "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/members/memberId" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"GET /v1/whiteboard/rooms/{uuid}/scenes
Get scene path list
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
sceneDir | query | string | 默认 "/" |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | Scene path list — array<string> |
401 | Missing or invalid project credentials / room token — Error |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/scenes?sceneDir=value" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/whiteboard/rooms/{uuid}/scenes
Add scenes
Creates a scene directory when it does not exist and inserts the scenes under it. Requires the writer or admin role.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
path | string | 是 | Scene directory starting with /.;pattern ^/ |
scenes | array<object{ name, ppt }> | 是 | 最多 100 项 |
{
"path": "string",
"scenes": [
{
"name": "demo",
"ppt": {
"src": "string",
"width": 1,
"height": 1
}
}
]
}响应
| 状态码 | 说明 / schema |
|---|---|
201 | Scenes added — object{ added, version } |
400 | Invalid parameter — Error |
401 | Missing or invalid project credentials / room token — Error |
403 | Token role is insufficient or the room is banned/closed — any |
409 | Operation conflicts with the current room state — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/scenes" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"path":"string","scenes":[{"name":"demo","ppt":{"src":"string","width":1,"height":1}}]}'GET /v1/whiteboard/rooms/{uuid}/scene-state
Get the current scene state
Returns the room state the Web SDK's Room.state mirrors: current scene path, viewport, scenes, member states and undo/redo counters.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | Room state — RoomState |
401 | Missing or invalid project credentials / room token — Error |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/scene-state" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"PATCH /v1/whiteboard/rooms/{uuid}/scene-state
Switch the current scene
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
scenePath | string | 是 | pattern ^/ |
{
"scenePath": "string"
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | Current scene path — object{ currentScenePath, version } |
400 | Invalid parameter — Error |
401 | Missing or invalid project credentials / room token — Error |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X PATCH "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/scene-state" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"scenePath":"string"}'POST /v1/whiteboard/rooms/{uuid}/strokes
Append a stroke
Persists one stroke in the current scene and appends a stroke.append operation to the replay timeline. Realtime clients publish the same payload on the LiveKit data channel topic whiteboard before or after this call; persistence is authoritative for replay.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
appliance | enum(pencil | pencilEraser | eraser | rectangle | ellipse | shape | selector | hand | clicker | laserPointer) | 是 | |
color | string | pattern ^#[0-9a-fA-F]{6}$,默认 "#1f6feb" | |
width | number | 1..64,默认 3 | |
points | array<object{ x, y }> | 是 | 最多 4096 项 |
memberId | string | Member identifier; defaults to the authenticated member.;长度 0..64 | |
scenePath | string | Scene to draw in; defaults to the current scene. |
{
"appliance": "pencil",
"points": [
{
"x": 1,
"y": 1
}
],
"color": "string",
"width": 1
}响应
| 状态码 | 说明 / schema |
|---|---|
201 | Stroke appended — object{ stroke, version, canUndoSteps } |
400 | Invalid parameter — Error |
401 | Missing or invalid project credentials / room token — Error |
403 | Token role is insufficient or the room is banned/closed — any |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/strokes" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"appliance":"pencil","points":[{"x":1,"y":1}],"color":"string","width":1}'DELETE /v1/whiteboard/rooms/{uuid}/strokes/{strokeId}
Erase a stroke
Marks the stroke as erased (retained in the operation log for replay) and appends a stroke.erase operation.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
strokeId | path | 是 | string | 长度 0..64 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | Stroke erased — object{ strokeId, version } |
401 | Missing or invalid project credentials / room token — Error |
403 | Token role is insufficient or the room is banned/closed — any |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X DELETE "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/strokes/strokeId" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/whiteboard/rooms/{uuid}/undo
Undo the caller's last operation
Undo is per member: it hides the most recent visible stroke this member appended in the current scene and moves it to that member's redo stack. Replay keeps both the append and the undo operation.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
memberId | string | 长度 0..64 |
{
"memberId": "string"
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | Undo applied — object{ strokeId, version, canUndoSteps, canRedoSteps } |
401 | Missing or invalid project credentials / room token — Error |
403 | Token role is insufficient or the room is banned/closed — any |
404 | Room, scene or stroke not found — Error |
409 | Operation conflicts with the current room state — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/undo" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"memberId":"string"}'POST /v1/whiteboard/rooms/{uuid}/redo
Redo the caller's last undone operation
Restores the most recent stroke undone by this member in the current scene, provided no later stroke was appended by that member. Replay records a stroke.redo operation.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
memberId | string | 长度 0..64 |
{
"memberId": "string"
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | Redo applied — object{ strokeId, version, canUndoSteps, canRedoSteps } |
401 | Missing or invalid project credentials / room token — Error |
403 | Token role is insufficient or the room is banned/closed — any |
404 | Room, scene or stroke not found — Error |
409 | Operation conflicts with the current room state — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/redo" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"memberId":"string"}'PUT /v1/whiteboard/rooms/{uuid}/viewport
Set the room viewport
Stores the camera viewport (x, y, width, height, scale) that late joiners and replay starts from.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
x | number | 是 | |
y | number | 是 | |
width | number | 是 | >= 1 |
height | number | 是 | >= 1 |
scale | number | 是 | 0.01..100 |
{
"x": 1,
"y": 1,
"width": 1,
"height": 1,
"scale": 1
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | Stored viewport — Viewport |
400 | Invalid parameter — Error |
401 | Missing or invalid project credentials / room token — Error |
403 | Token role is insufficient or the room is banned/closed — any |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X PUT "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/viewport" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"x":1,"y":1,"width":1,"height":1,"scale":1}'POST /v1/whiteboard/rooms/{uuid}/images
Insert an image
Records an image placed in a scene (the bytes live in the caller's storage; this endpoint stores the URL and geometry). Appends an image.insert operation.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
src | string | 是 | 长度 1..∞ |
width | number | 是 | >= 1 |
height | number | 是 | >= 1 |
x | number | ||
y | number | ||
scenePath | string | ||
locked | boolean | ||
memberId | string | 长度 0..64 |
{
"src": "string",
"width": 1,
"height": 1,
"x": 1,
"y": 1
}响应
| 状态码 | 说明 / schema |
|---|---|
201 | Image inserted — object{ image, version } |
400 | Invalid parameter — Error |
401 | Missing or invalid project credentials / room token — Error |
403 | Token role is insufficient or the room is banned/closed — any |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/images" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"src":"string","width":1,"height":1,"x":1,"y":1}'GET /v1/whiteboard/rooms/{uuid}/snapshot
Export a room snapshot
Returns the full scene document plus operation log: the export format consumed by the Web SDK Room.exportScene/importScene equivalents and by offline replay.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
includeOperations | query | boolean | 默认 true |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | Room snapshot — Snapshot |
401 | Missing or invalid project credentials / room token — Error |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/snapshot?includeOperations=true" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"GET /v1/whiteboard/rooms/{uuid}/snapshot.svg
Render the current scene as SVG
Server-side export of the current scene (strokes, images, background) as an SVG document. Used by exports and thumbnails; the deprecated Agora screenshot endpoints are not reproduced.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
scenePath | query | string |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | SVG document |
401 | Missing or invalid project credentials / room token — Error |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/snapshot.svg?scenePath=value" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"GET /v1/whiteboard/rooms/{uuid}/replay
Get the replay timeline
Returns ordered operation frames with offsets relative to the first retained operation. Optional from/to ISO instants narrow the window; the SDK Player consumes the result.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
from | query | string | format date-time | |
to | query | string | format date-time |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | Replay timeline — Replay |
400 | Invalid parameter — Error |
401 | Missing or invalid project credentials / room token — Error |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/whiteboard/rooms/uuid/replay?from=%24FROM&to=%24TO" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/whiteboard/tokens/rooms/{uuid}
Generate a room token
Mints a NETLESSROOM_* token bound to one room. The requested role may not exceed the role of the credential used to mint it. A lifespan of 0 (or omitted) means no expiry, matching the frozen semantics.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
uuid | path | 是 | string | 长度 8..64,pattern ^[A-Za-z0-9_-]+$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
role | enum(admin | writer | reader) | 默认 "writer" | |
lifespan | integer | Lifespan in milliseconds; 0 means no expiry.;>= 0 |
{
"role": "admin",
"lifespan": 1
}响应
| 状态码 | 说明 / schema |
|---|---|
201 | Minted room token — RoomToken |
400 | Invalid parameter — Error |
401 | Missing or invalid project credentials / room token — Error |
403 | Token role is insufficient or the room is banned/closed — any |
404 | Room, scene or stroke not found — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/whiteboard/tokens/rooms/uuid" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"role":"admin","lifespan":1}'POST /v1/whiteboard/tokens/teams
Generate a project (SDK) token
Mints a NETLESSSDK_* token usable for every room of the authenticated project. Intended for server-to-server wiring only; never ship it to clients.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
role | enum(admin | writer | reader) | 默认 "admin" | |
lifespan | integer | >= 0 |
{
"role": "admin",
"lifespan": 1
}响应
| 状态码 | 说明 / schema |
|---|---|
201 | Minted project token — SdkToken |
400 | Invalid parameter — Error |
401 | Missing or invalid project credentials / room token — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/whiteboard/tokens/teams" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"role":"admin","lifespan":1}'本分组用到的 Schema
Error — object{ code, message, reason, sdkCode, details }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | enum(whiteboard_room_not_found | whiteboard_scene_not_found | whiteboard_stroke_not_found | whiteboard_room_banned | whiteboard_room_closed | whiteboard_token_role_forbidden | whiteboard_token_room_mismatch | whiteboard_invalid_scene_path | whiteboard_invalid_operation | whiteboard_undo_empty | whiteboard_redo_empty | whiteboard_version_conflict | invalid_parameter | invalid_token | token_expired | missing_authorization | unauthorized | invalid_credentials | rate_limited | internal_error) | 是 | Stable machine code. Whiteboard codes: whiteboard_room_not_found, whiteboard_scene_not_found, whiteboard_stroke_not_found, whiteboard_room_banned, whiteboard_room_closed, whiteboard_token_role_forbidden, whiteboard_token_room_mismatch, whiteboard_invalid_scene_path, whiteboard_invalid_operation, whiteboard_undo_empty, whiteboard_redo_empty, whiteboard_version_conflict. |
message | string | 是 | |
reason | string | ||
sdkCode | integer | ||
details | object |
Image — object
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 是 | |
scenePath | string | 是 | |
src | string | 是 | |
width | number | 是 | >= 1 |
height | number | 是 | >= 1 |
x | number | ||
y | number | ||
locked | boolean | ||
memberId | string | ||
createdAt | string | format date-time |
Operation — object
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
seq | integer | 是 | >= 1 |
type | enum(scene.add | scene.switch | scene.clear | stroke.append | stroke.erase | stroke.undo | stroke.redo | image.insert | viewport.set | room.ban | room.close) | 是 | |
memberId | string | 是 | |
scenePath | string | ||
strokeId | string | ||
roomVersion | integer | ||
payload | object | ||
createdAt | string | 是 | format date-time |
Point — object{ x, y }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
x | number | 是 | World-coordinate X in whiteboard units. |
y | number | 是 | World-coordinate Y in whiteboard units. |
Replay — object{ roomUUID, duration, from, to, frames }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
roomUUID | string | 是 | |
duration | integer | 是 | Timeline duration in milliseconds. |
from | string | format date-time | |
to | string | format date-time | |
frames | array<object{ offset, operation }> | 是 |
Room — object
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
uuid | string | 是 | |
teamUUID | string | 是 | Owning account id (Agora teamUUID). |
appUUID | string | 是 | Owning project App ID (Agora appUUID). |
isRecord | boolean | 是 | |
isBan | boolean | 是 | |
phase | enum(active | banned | closed) | 是 | |
limit | integer | 是 | >= 0 |
version | integer | 是 | >= 0 |
createdAt | string | 是 | format date-time |
updatedAt | string | format date-time | |
closedAt | string | format date-time |
RoomState — object
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
room | object | 是 | |
currentScenePath | string | 是 | |
viewport | object{ x, y, width, height, scale, updatedAt } | 是 | Camera viewport in world coordinates; width/height are the visible world size. |
scenes | array<object> | 是 | |
memberStates | object | 是 | |
canUndoSteps | integer | 是 | |
canRedoSteps | integer | 是 |
RoomToken — object{ token, role, uuid, lifespan, expireAt }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
token | string | 是 | NETLESSROOM_* token for the token header. |
role | enum(admin | writer | reader) | 是 | |
uuid | string | 是 | |
lifespan | integer | 是 | Requested lifespan in milliseconds; 0 means no expiry. |
expireAt | string | 是 | format date-time |
Scene — object
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
path | string | 是 | Scene path including directory, for example /test/page1. |
name | string | 是 | |
ppt | object{ src, width, height } | ||
strokeCount | integer | ||
imageCount | integer | ||
createdAt | string | format date-time | |
updatedAt | string | format date-time |
ScenePpt — object{ src, width, height }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
src | string | Background image URL or data URI. | |
width | number | ||
height | number |
SdkToken — object{ token, role, appUUID, lifespan, expireAt }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
token | string | 是 | NETLESSSDK_* project-scoped token. |
role | enum(admin | writer | reader) | 是 | |
appUUID | string | 是 | |
lifespan | integer | 是 | |
expireAt | string | 是 | format date-time |
Snapshot — object
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
roomUUID | string | 是 | |
appUUID | string | 是 | |
roomVersion | integer | 是 | |
exportedAt | string | 是 | format date-time |
currentScenePath | string | ||
viewport | object{ x, y, width, height, scale, updatedAt } | Camera viewport in world coordinates; width/height are the visible world size. | |
scenes | array<object{ path, name, ppt, strokes, images }> | 是 | |
operations | array<object> |
Stroke — object
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 是 | |
scenePath | string | 是 | |
appliance | enum(pencil | pencilEraser | eraser | rectangle | ellipse | shape | selector | hand | clicker | laserPointer) | 是 | |
color | string | pattern ^#[0-9a-fA-F]{6}$ | |
width | number | 1..64 | |
points | array<object{ x, y }> | 是 | 最多 4096 项 |
memberId | string | 是 | |
seq | integer | >= 1 | |
undone | boolean | ||
createdAt | string | format date-time |
Viewport — object{ x, y, width, height, scale, updatedAt }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
x | number | 是 | |
y | number | 是 | |
width | number | 是 | >= 1 |
height | number | 是 | >= 1 |
scale | number | 是 | 0.01..100 |
updatedAt | string | format date-time |