记录 API
创建、检索和更新表记录。
除非另有说明,所有路径均相对于 https://www.labii.dev,并且需要使用 Bearer 令牌进行身份验证。请将每个占位符替换为 Labii 环境中的相应标识符。
端点
| 操作 | 方法 | 路径 |
|---|---|---|
| 获取记录列表 | GET | /tables/row/list/organization/{{organization_sid}}/list/?table__sid={{table_sid}} |
| 创建记录 | POST | /tables/row/list/organization/{{organization_sid}}/list/?table__sid={{table_sid}} |
| 获取记录详情 | GET | /tables/row/detail/{{row_sid}}/ |
| 更新记录 | PATCH | /tables/row/detail/{{row_sid}}/ |
| 批量创建记录 | POST | /tables/row/bulk/organization/{{organization_sid}}/ |
| 获取包含列的记录 | GET | /tables/row/column/{{row_sid}}/ |
| 获取包含章节的记录 | GET | /tables/row/section/{{row_sid}}/ |
| 获取包含章节名称的记录 | GET | /tables/row/sectionname/{{row_sid}}/ |
| 获取记录副本表示 | GET | /tables/row/duplicate/{{row_sid}}/ |
| 向记录上传文件 | POST | /tables/row/upload/{{row_sid}}/ |
| 获取模板列表 | GET | /tables/template/list/organization/{{organization_sid}}/list/ |
| 创建模板 | POST | /tables/template/list/organization/{{organization_sid}}/list/ |
| 获取模板详情 | GET | /tables/template/detail/{{row_sid}}/ |
| 更新模板 | PATCH | /tables/template/detail/{{row_sid}}/ |
列表端点的最后一个 URL 段用于选择响应序列化器。示例使用 list;支持的端点还可以提供 name 或 detail 等表示形式。
序列化器字段
列表响应项: sid, uid, name, description, column_set, workspaces, owner, is_template, is_archived, date_created, date_updated, updated_by, change_permission, verbose_name
详情响应: sid, uid, version, table, workspaces, name, description, column_set, section_set, is_template, is_archived, is_locked, metadata, updated_by, date_updated, owner, date_created, data, change_permission, help_text, verbose_name
写入序列化器: sid, uid, table, workspaces, name, description, is_template, is_locked, is_archived, metadata, data, owner, 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,
"uid": null,
"name": null,
"description": null,
"column_set": null,
"workspaces": null,
"owner": null,
"is_template": null,
"is_archived": null,
"date_created": null,
"date_updated": null,
"updated_by": null,
"change_permission": null,
"verbose_name": null
}
]
}
详情响应 JSON
以下值为占位值,用于展示当前详情序列化器返回的确切键。嵌套关系和元数据的值取决于具体资源。
{
"sid": null,
"uid": null,
"version": null,
"table": null,
"workspaces": null,
"name": null,
"description": null,
"column_set": null,
"section_set": null,
"is_template": null,
"is_archived": null,
"is_locked": null,
"metadata": null,
"updated_by": null,
"date_updated": null,
"owner": null,
"date_created": null,
"data": null,
"change_permission": null,
"help_text": null,
"verbose_name": null
}
请求示例
curl --request GET \
--url 'https://www.labii.dev/tables/row/list/organization/{{organization_sid}}/list/?table__sid={{table_sid}}' \
--header 'Authorization: Bearer <api_key>'