跳到主要内容

通知 API

创建、检索、更新和删除通知。

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

端点​

操作方法路径
获取通知列表GET/notifications/notification/list/organization/{{organization_sid}}/list/
创建通知POST/notifications/notification/list/organization/{{organization_sid}}/list/
获取通知详情GET/notifications/notification/detail/{{notification_sid}}/
更新通知PATCH/notifications/notification/detail/{{notification_sid}}/
删除通知DELETE/notifications/notification/detail/{{notification_sid}}/

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

序列化器字段​

列表响应项: sid, From, name, is_read, rows, date_to_send_email, date_sent, change_permission, verbose_name

详情响应: sid, rows, From, to, emails, wecom_receipts, name, body, rows, should_include_rows, should_email, should_bcc, should_encrypt, should_verify_email, should_check_email_opened, date_to_send_email, is_read, updated_by, date_updated, date_created, date_sent, change_permission, help_text, verbose_name, is_archived

写入序列化器: sid, organization, rows, name, personnel, to, emails, wecom_receipts, name, body, should_email, should_bcc, should_encrypt, should_verify_email, should_check_email_opened, date_to_send_email, should_include_rows, updated_by, date_updated, date_created, is_archived

写入序列化器是后端验证架构。视图可能根据 URL 或已验证用户填充标识、父级和审计字段,也可能禁止特定操作修改某些字段。

列表响应 JSON​

以下值为占位值,用于展示当前列表序列化器返回的确切键。这并不表示每个字段都可以为 null。

{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 1,
"next": null,
"previous": null,
"add_permission": false,
"results": [
{
"sid": null,
"From": null,
"name": null,
"is_read": null,
"rows": null,
"date_to_send_email": null,
"date_sent": null,
"change_permission": null,
"verbose_name": null
}
]
}

详情响应 JSON​

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

{
"sid": null,
"rows": null,
"From": null,
"to": null,
"emails": null,
"wecom_receipts": null,
"name": null,
"body": null,
"should_include_rows": null,
"should_email": null,
"should_bcc": null,
"should_encrypt": null,
"should_verify_email": null,
"should_check_email_opened": null,
"date_to_send_email": null,
"is_read": null,
"updated_by": null,
"date_updated": null,
"date_created": null,
"date_sent": null,
"change_permission": null,
"help_text": null,
"verbose_name": null,
"is_archived": null
}

请求示例​

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