跳到主要内容

筛选器 API

创建和管理已保存的表筛选器。

除非另有说明,所有路径均相对于 https://www.labii.dev,并且需要使用 Bearer 令牌进行身份验证。请将每个占位符替换为 Labii 环境中的相应标识符。

端点​

操作方法路径
获取筛选器列表GET/tables/filter/list/organization/{{organization_sid}}/list/?table__sid={{table_sid}}
创建筛选器POST/tables/filter/list/organization/{{organization_sid}}/list/?table__sid={{table_sid}}
获取筛选器详情GET/tables/filter/detail/{{filter_sid}}/
更新筛选器PATCH/tables/filter/detail/{{filter_sid}}/
删除筛选器DELETE/tables/filter/detail/{{filter_sid}}/
获取筛选器模板GET/tables/filter/templates/

列表端点的最后一个 URL 段用于选择响应序列化器。示例使用 list;支持的端点还可以提供 name 或 detail 等表示形式。

序列化器字段​

列表响应项: icon, name, ref, sid, description, owners, teams, show_in_menu, digest_frequency, is_archived, order, table, change_permission, verbose_name

详情响应: sid, table, name, description, ref, icon, color, order, query, query_exclude, owners, teams, digest_frequency, should_send_digest_email_if_empty, ics, show_in_menu, is_default, is_archived, date_updated, date_created, updated_by, change_permission, help_text, verbose_name

写入序列化器: sid, table, name, description, ref, icon, color, order, query, query_exclude, owners, teams, show_in_menu, digest_frequency, should_send_digest_email_if_empty, is_default, 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": [
{
"icon": null,
"name": null,
"ref": null,
"sid": null,
"description": null,
"owners": null,
"teams": null,
"show_in_menu": null,
"digest_frequency": null,
"is_archived": null,
"order": null,
"table": null,
"change_permission": null,
"verbose_name": null
}
]
}

详情响应 JSON​

以下值为占位值,用于展示当前详情序列化器返回的确切键。嵌套关系和元数据的值取决于具体资源。

{
"sid": null,
"table": null,
"name": null,
"description": null,
"ref": null,
"icon": null,
"color": null,
"order": null,
"query": null,
"query_exclude": null,
"owners": null,
"teams": null,
"digest_frequency": null,
"should_send_digest_email_if_empty": null,
"ics": null,
"show_in_menu": null,
"is_default": null,
"is_archived": null,
"date_updated": null,
"date_created": null,
"updated_by": null,
"change_permission": null,
"help_text": null,
"verbose_name": null
}

请求示例​

curl --request GET \
--url 'https://www.labii.dev/tables/filter/list/organization/{{organization_sid}}/list/?table__sid={{table_sid}}' \
--header 'Authorization: Bearer <api_key>'