列 API
创建、检索和更新表中的列。
除非另有说明,所有路径均相对于 https://www.labii.dev,并且需要使用 Bearer 令牌进行身份验证。请将每个占位符替换为 Labii 环境中的相应标识符。
端点
| 操作 | 方法 | 路径 |
|---|---|---|
| 获取列列表 | GET | /tables/column/list/organization/{{organization_sid}}/list/?table__sid={{table_sid}} |
| 创建列 | POST | /tables/column/list/organization/{{organization_sid}}/list/?table__sid={{table_sid}} |
| 获取列详情 | GET | /tables/column/detail/{{column_sid}}/ |
| 更新列 | PATCH | /tables/column/detail/{{column_sid}}/ |
| 获取列模板 | GET | /tables/column/templates/ |
列表端点的最后一个 URL 段用于选择响应序列化器。示例使用 list;支持的端点还可以提供 name 或 detail 等表示形式。
序列化器字段
列表响应项: name, ref, sid, description, widget, is_required, should_hide_in_form_view, should_hide_in_list_view, is_archived, order, table, change_permission, verbose_name
详情响应: name, name_system, ref, sid, description, table, widget, configuration, ai_configuration, permission, default_data, order, is_required, should_hide_in_form_view, should_hide_in_list_view, should_disable_copying, should_mask_data, max_width, metadata, is_archived, date_created, date_updated, updated_by, change_permission, help_text, verbose_name
写入序列化器: sid, table, name, ref, description, widget, configuration, ai_configuration, permission, default_data, order, is_required, should_hide_in_form_view, should_hide_in_list_view, should_disable_copying, should_mask_data, max_width, metadata, is_archived, 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": [
{
"name": null,
"ref": null,
"sid": null,
"description": null,
"widget": null,
"is_required": null,
"should_hide_in_form_view": null,
"should_hide_in_list_view": null,
"is_archived": null,
"order": null,
"table": null,
"change_permission": null,
"verbose_name": null
}
]
}
详情响应 JSON
以下值为占位值,用于展示当前详情序列化器返回的确切键。嵌套关系和元数据的值取决于具体资源。
{
"name": null,
"name_system": null,
"ref": null,
"sid": null,
"description": null,
"table": null,
"widget": null,
"configuration": null,
"ai_configuration": null,
"permission": null,
"default_data": null,
"order": null,
"is_required": null,
"should_hide_in_form_view": null,
"should_hide_in_list_view": null,
"should_disable_copying": null,
"should_mask_data": null,
"max_width": null,
"metadata": null,
"is_archived": null,
"date_created": null,
"date_updated": null,
"updated_by": null,
"change_permission": null,
"help_text": null,
"verbose_name": null
}
请求示例
curl --request GET \
--url 'https://www.labii.dev/tables/column/list/organization/{{organization_sid}}/list/?table__sid={{table_sid}}' \
--header 'Authorization: Bearer <api_key>'