跳到主要内容

公司 API

检索和更新 Labii 公司。

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

端点​

操作方法路径
获取公司列表GET/organizations/organization/list/user/{{user_sid}}/list/
获取公司详情GET/organizations/organization/detail/{{organization_sid}}/
更新公司PATCH/organizations/organization/detail/{{organization_sid}}/

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

序列化器字段​

列表响应项: sid, name, username, description, logo_icon, logo_wordmark, is_academic, plan, change_permission

详情响应: sid, name, username, description, language, logo_icon, logo_wordmark, navbar_background_color, navbar_text_color, home_message, print_header, print_footer, name_format, workspaces_display_name, plan, period_end, enable_antivirus_scan, enable_password_expiration, password_expiration_days, should_enable_mfa, session_timeout_minutes, should_use_custom_email_domain, email_template, wecom_corp_id, wecom_corp_secret, wecom_agent_id, metadata, credits, application_quota, table_quota_per_application, is_academic, close_account, update_reference, updated_by, date_updated, date_created, personnel, is_archived, help_text, verbose_name, change_permission

写入序列化器: sid, name, username, description, language, logo_icon, logo_wordmark, navbar_background_color, navbar_text_color, home_message, print_header, print_footer, name_format, workspaces_display_name, plan, is_academic, metadata, should_use_custom_email_domain, email_template, wecom_corp_id, wecom_corp_secret, wecom_agent_id, enable_antivirus_scan, enable_password_expiration, password_expiration_days, should_enable_mfa, session_timeout_minutes, 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,
"username": null,
"description": null,
"logo_icon": null,
"logo_wordmark": null,
"is_academic": null,
"plan": null,
"change_permission": null
}
]
}

详情响应 JSON​

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

{
"sid": null,
"name": null,
"username": null,
"description": null,
"language": null,
"logo_icon": null,
"logo_wordmark": null,
"navbar_background_color": null,
"navbar_text_color": null,
"home_message": null,
"print_header": null,
"print_footer": null,
"name_format": null,
"workspaces_display_name": null,
"plan": null,
"period_end": null,
"enable_antivirus_scan": null,
"enable_password_expiration": null,
"password_expiration_days": null,
"should_enable_mfa": null,
"session_timeout_minutes": null,
"should_use_custom_email_domain": null,
"email_template": null,
"wecom_corp_id": null,
"wecom_corp_secret": null,
"wecom_agent_id": null,
"metadata": null,
"credits": null,
"application_quota": null,
"table_quota_per_application": null,
"is_academic": null,
"close_account": null,
"update_reference": null,
"updated_by": null,
"date_updated": null,
"date_created": null,
"personnel": null,
"is_archived": null,
"help_text": null,
"verbose_name": null,
"change_permission": null
}

请求示例​

curl --request GET \
--url 'https://www.labii.dev/organizations/organization/list/user/{{user_sid}}/list/' \
--header 'Authorization: Bearer <api_key>'