获取¶
GET /api/v1/notes/{notes_uuid}/get
概述¶
获取旧版笔记详情及图表。
调用前和使用步骤¶
使用笔记列表提供的 UUID。在结果的 charts 中读取当前活跃图表,包括图表名、类型和查询定义。结果优先按笔记中的图表顺序,再追加未在顺序列表中的所属图表。
路由参数¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| notes_uuid | string | Y | 目标旧版笔记的 UUID。 例子: note_example获取或填写方式: 从笔记列表的 content.data[].uuid 取得,也可用创建响应的 content.uuid。 |
请求头¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| DF-API-KEY | string | Y | 工作空间的 OpenAPI 鉴权凭据。 例子: <DF-API-KEY>获取或填写方式: 从目标工作空间的 API Key 管理获取有该操作权限的 OpenAPI Key。 |
参数补充说明¶
详情中的 charts 为按所属笔记查询到的图表对象。
请求例子¶
curl --get 'https://openapi.guance.com/api/v1/notes/note_example/get' \
-H 'DF-API-KEY: <DF-API-KEY>'
响应¶
HTTP 200,application/json。下方示例展示可直接读取的主要字段。
| 字段 | 类型 | 说明 |
|---|---|---|
| content.id | integer | 笔记记录编号。 |
| content.uuid | string | 笔记 UUID,用于查询、修改、导入和删除。 |
| content.name | string | 笔记名称。 |
| content.workspaceUUID | string | 所属工作空间。 |
| content.isPublic | integer | 可见范围,1 为公开,0 为仅创建身份。 |
| content.extend | object | 笔记扩展配置。 |
| content.status | integer | 笔记当前状态。 |
| content.creator | string | 创建者身份 ID。 |
| content.updator | string | 最近更新者身份 ID,未更新时可为空。 |
| content.createAt | number | 创建时间,Unix 秒。 |
| content.updateAt | number | 最近更新时间,Unix 秒。未更新时可为 -1。 |
| content.deleteAt | number | 删除时间,Unix 秒。未删除时为 -1。 |
| content.creatorInfo | object | 创建者信息,未找到时为空对象。 |
| content.updatorInfo | object | 最近更新者信息,未找到时为空对象。 |
| content.creatorInfo.uuid | string | 查询到对应身份时可能提供。身份标识。 |
| content.creatorInfo.status | integer | 查询到对应身份时可能提供。账号状态。 |
| content.creatorInfo.wsAccountStatus | integer | 查询到对应身份时可能提供。空间成员状态。 |
| content.creatorInfo.username | string | 查询到对应身份时可能提供。账号登录名称。 |
| content.creatorInfo.name | string | 查询到对应身份时可能提供。显示名称。 |
| content.creatorInfo.iconUrl | string | 查询到对应身份时可能提供。头像 URL。 |
| content.creatorInfo.email | string | 查询到对应身份时可能提供。账号邮箱。API Key 身份可能返回其标识。 |
| content.creatorInfo.mobile | string | 查询到对应身份时可能提供。联系方式。 |
| content.creatorInfo.countryCode | string | 查询到对应身份时可能提供。手机号国家或地区代码。 |
| content.creatorInfo.acntWsNickname | string | 查询到对应身份时可能提供。工作空间内昵称。 |
| content.updatorInfo.uuid | string | 查询到对应身份时可能提供。身份标识。 |
| content.updatorInfo.status | integer | 查询到对应身份时可能提供。账号状态。 |
| content.updatorInfo.wsAccountStatus | integer | 查询到对应身份时可能提供。空间成员状态。 |
| content.updatorInfo.username | string | 查询到对应身份时可能提供。账号登录名称。 |
| content.updatorInfo.name | string | 查询到对应身份时可能提供。显示名称。 |
| content.updatorInfo.iconUrl | string | 查询到对应身份时可能提供。头像 URL。 |
| content.updatorInfo.email | string | 查询到对应身份时可能提供。账号邮箱。API Key 身份可能返回其标识。 |
| content.updatorInfo.mobile | string | 查询到对应身份时可能提供。联系方式。 |
| content.updatorInfo.countryCode | string | 查询到对应身份时可能提供。手机号国家或地区代码。 |
| content.updatorInfo.acntWsNickname | string | 查询到对应身份时可能提供。工作空间内昵称。 |
| content.charts | array<object> |
当前属于笔记的有效图表。 |
| content.declaration | object 或 null | 工作空间的公共声明。 |
| content.charts[].id | integer | 图表记录编号。 |
| content.charts[].uuid | string | 图表 UUID。 |
| content.charts[].name | string | 图表名称。 |
| content.charts[].type | string | 图表类型。 |
| content.charts[].notesUUID | string | 图表所属笔记 UUID。 |
| content.charts[].workspaceUUID | string | 所属工作空间。 |
| content.charts[].chartGroupUUID | string | 所属图表组,可为空字符串。 |
| content.charts[].dashboardUUID | string | 关联的仪表板标识,可为空字符串。 |
| content.charts[].isWorkspaceKeyIndicator | integer | 是否标为工作空间关键指标,0 否,1 是。 |
| content.charts[].queries | array<object> |
查询或笔记内容定义。 |
| content.charts[].extend | object | 图表扩展配置。 |
| content.charts[].status | integer | 图表当前状态。 |
| content.charts[].creator | string | 创建者身份 ID。 |
| content.charts[].updator | string | 最近更新者身份 ID,未更新时可为空。 |
| content.charts[].createAt | number | 创建时间,Unix 秒。 |
| content.charts[].updateAt | number | 最近更新时间,Unix 秒。未更新时可为 -1。 |
| content.charts[].deleteAt | number | 删除时间,Unix 秒。未删除时为 -1。 |
{
"code": 200,
"content": {
"id": 11,
"uuid": "note_example",
"name": "生产巡检笔记",
"workspaceUUID": "wksp_example",
"isPublic": 1,
"extend": {},
"status": 0,
"creator": "wsak_example",
"updator": "",
"createAt": 1785427200,
"updateAt": -1,
"deleteAt": -1,
"creatorInfo": {},
"updatorInfo": {},
"charts": [
{
"name": "巡检说明",
"type": "text",
"queries": [
{
"query": {
"content": "按仪表板核对生产状态。"
}
}
],
"extend": {},
"id": 40,
"uuid": "chrt_example",
"workspaceUUID": "wksp_example",
"notesUUID": "note_example",
"chartGroupUUID": "",
"dashboardUUID": "",
"isWorkspaceKeyIndicator": 0,
"status": 0,
"creator": "wsak_example",
"updator": "",
"createAt": 1785427200,
"updateAt": -1,
"deleteAt": -1
}
],
"declaration": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
错误响应¶
鉴权、限流和公共请求错误参见公共错误定义。
| HTTP 状态 | errorCode | 触发条件 | 消息或响应说明 | 处理方式 |
|---|---|---|---|---|
| 404 | ft.NotFoundNote | UUID 已删除、不存在或不在当前 API Key 的工作空间 | 未找到指定笔记 | 用同一工作空间的笔记列表核对 UUID。 |