查询通知列表

查询当前用户的通知及已读状态。

GET https://billing.moi.matrixorigin.cn/api/v1/taas/notifications

调用前准备

准备个人访问令牌。创建和管理方法参阅创建和管理个人访问令牌

查询范围为当前用户有权访问的数据。

查询参数

将示例中的 $MOI_PERSONAL_ACCESS_TOKEN 替换为个人访问令牌。

curl --get "https://billing.moi.matrixorigin.cn/api/v1/taas/notifications" \
  -H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN" \
  --data-urlencode "page_size=2"

将响应中的 next_page_token 保存为 $NEXT_PAGE_TOKEN,保持筛选条件不变并请求下一页。该值为空或省略时停止翻页。

curl --get "https://billing.moi.matrixorigin.cn/api/v1/taas/notifications" \
  -H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN" \
  --data-urlencode "page_size=2" \
  --data-urlencode "page_token=$NEXT_PAGE_TOKEN"

参数

类型

是否必填

说明

category

string

分类:usagekeycallsecurityservice

priority

string

优先级:severeimportantnormal

read

string

已读筛选:truefalse;省略时不限制。

time_range

string

时间范围:alltoday、7d 或 30d;默认 7d。today 按服务端时区从当日零点开始。

page_size

integer

每页数量,默认 100,最大 1000。

page_token

string

上一页返回的下一页标记;首个请求省略。

成功响应

返回 HTTP 200,响应包含当前页的通知及分页信息。

{
  "items": [],
  "total": 0,
  "next_page_token": ""
}

字段

类型

说明

items

array of object

本页记录。

items[].id

string

通知 ID。

items[].user_id

string

所属用户 ID。

items[].rule_key

string

触发通知的规则标识。

items[].category

string

通知分类。

items[].priority

string

优先级:severeimportantnormal

items[].title

string

通知标题。

items[].summary

string

通知摘要。

items[].state

string

通知状态。

items[].scope_type

string

关联对象类型;有值时返回。

items[].scope_id

string

关联对象 ID;有值时返回。

items[].scope_name

string

关联对象名称;有值时返回。

items[].source_type

string

通知来源类型;有值时返回。

items[].source_id

string

通知来源 ID;有值时返回。

items[].action_url

string

相关操作链接;有值时返回。

items[].fingerprint

string

通知事件指纹;有值时返回。

items[].seq

integer

通知序号。

items[].read

boolean

通知是否已读。

items[].occurred_at

integer

事件发生时间,Unix 秒。

items[].created_at

integer

通知创建时间,Unix 秒。

items[].updated_at

integer

更新时间,Unix 秒。

total

integer

符合筛选条件的总记录数。

next_page_token

string

下一页标记;为空或省略时已到最后一页。

字段路径中的 [] 表示数组中的每一项。

最后更新于