Arkloop Developers

Notifications

站内通知。所有端点需要 Bearer Token 认证。

列出通知

GET /v1/notifications

查询参数

参数类型说明
unread_onlybool只返回未读,默认 false
typestring按通知类型过滤

响应

{
  "data": [
    {
      "id": "...",
      "user_id": "...",
      "org_id": "...",
      "type": "broadcast",
      "title": "系统维护通知",
      "body": "将于今晚 22:00 进行例行维护...",
      "payload": {},
      "read_at": null,
      "created_at": "2024-01-01T00:00:00Z"
    }
  ]
}

标记所有通知为已读

PATCH /v1/notifications

响应

{ "ok": true, "count": 5 }

标记单条通知为已读

PATCH /v1/notifications/{notification_id}

响应

{ "ok": true }

管理员广播

管理员可向所有用户或特定组织发送广播通知。

创建广播

POST /v1/admin/notifications/broadcasts

需要 platform_admin 权限。

请求体

字段类型必填说明
typestring通知类型
titlestring标题
bodystring正文
targetstringall 或具体 org_id
payloadobject附加数据

响应 202 Accepted

{
  "id": "...",
  "type": "announcement",
  "title": "新功能上线",
  "body": "...",
  "target_type": "all",
  "target_id": null,
  "payload": {},
  "status": "pending",
  "sent_count": 0,
  "created_by": "...",
  "created_at": "2024-01-01T00:00:00Z"
}

列出广播

GET /v1/admin/notifications/broadcasts

查询参数

参数类型说明
limitint
cursorstring

获取广播详情

GET /v1/admin/notifications/broadcasts/{broadcast_id}

删除广播

DELETE /v1/admin/notifications/broadcasts/{broadcast_id}

On this page