仪表板 API
创建和管理人员的仪表板小插件。
除非另有说明,所有路径均相对于 https://www.labii.dev,并且需要使用 Bearer 令牌进行身份验证。请将每个占位符替换为 Labii 环境中的相应标识符。
端点
| 操作 | 方法 | 路径 |
|---|---|---|
| 获取仪表板列表 | GET | /dashboard/dashboard/list/organization/{{organization_sid}}/list/ |
| 创建仪表板 | POST | /dashboard/dashboard/list/organization/{{organization_sid}}/list/ |
| 获取仪表板详情 | GET | /dashboard/dashboard/detail/{{dashboard_sid}}/ |
| 更新仪表板 | PATCH | /dashboard/dashboard/detail/{{dashboard_sid}}/ |
| 删除仪表板 | DELETE | /dashboard/dashboard/detail/{{dashboard_sid}}/ |
| 获取仪表板模板 | GET | /dashboard/dashboard/templates/ |
列表端点的最后一个 URL 段用于选择响应序列化器。示例使用 list;支持的端点还可以提供 name 或 detail 等表示形式。
序列化器字段
列表响应项: sid, name, size, height, should_display_as_icon, order, widget, change_permission, verbose_name
详情响应: sid, name, size, height, should_display_as_icon, order, widget, table, data, change_permission, help_text, verbose_name
写入序列化器: sid, name, size, height, should_display_as_icon, order, widget, table, personnel, data, updated_by, date_updated, date_created
写入序列化器是后端验证架构。视图可能根据 URL 或已验证用户填充标识、父级和审计字段,也可能禁止特定操作修改某些字段。
列表响应 JSON
以下值为占位值,用于展示当前列表序列化器返回的确切键。这并不表示每个字段都可以为 null。
{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 1,
"next": null,
"previous": null,
"add_permission": false,
"results": [
{
"sid": null,
"name": null,
"size": null,
"height": null,
"should_display_as_icon": null,
"order": null,
"widget": null,
"change_permission": null,
"verbose_name": null
}
]
}
详情响应 JSON
以下值为占位值,用于展示当前详情序列化器返回的确切键。嵌套关系和元数据的值取决于具体资源。
{
"sid": null,
"name": null,
"size": null,
"height": null,
"should_display_as_icon": null,
"order": null,
"widget": null,
"table": null,
"data": null,
"change_permission": null,
"help_text": null,
"verbose_name": null
}
请求示例
curl --request GET \
--url 'https://www.labii.dev/dashboard/dashboard/list/organization/{{organization_sid}}/list/' \
--header 'Authorization: Bearer <api_key>'