查询通知列表

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

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

否

分类:usage、key、call、security 或 service。

priority

string

否

优先级:severe、important 或 normal。

read

string

否

已读筛选:true 或 false。省略时不限制。

time_range

string

否

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

page_size

integer

否

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

page_token

string

否

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

成功响应

{
  "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

优先级:severe、important 或 normal。

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

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

最后更新于