列出当前认证用户的消息通知
GET/api/v5/notifications
Request
Query Parameters
用户授权码;也可使用 Authorization: Bearer <access_token> 请求头认证
页码;默认 1;必须为正整数
每页条数;默认 30;取值范围 1–100
读取状态;unread:仅未读(默认);read:仅已读;all:全部(含已读)
单选消息来源;不传表示全部类型。pull_request:PR;issue:Issue;mention:@我的;invitation:邀请消息;pipeline_alert:流水线告警;system:系统消息。可与 state 独立组合
仅获取创建时间严格晚于此时间的消息;格式 yyyy-MM-dd'T'HH:mm:ssXXX;与 before 同传时必须早于 before;URL 中 + 编码为 %2B
仅获取创建时间严格早于此时间的消息;格式 yyyy-MM-dd'T'HH:mm:ssXXX;URL 中 + 编码为 %2B
Responses
- 200
Response Headers
- application/json
- Schema
- Example (auto)
Schema
- Array [
- ]
符合筛选条件的消息总条数,与响应头 total_count 一致
list object[]required
当前页的消息通知;无数据时为空数组
消息 ID
消息内容,与消息中心一致,可能包含 HTML
消息来源:pull_request(PR)、issue(Issue)、mention(@我的)、invitation(邀请)、pipeline_alert(流水线告警)、system(系统);其他来源保留原始类型
是否未读;true 为未读,false 为已读
消息创建时间。固定北京时间,格式 yyyy-MM-dd'T'HH:mm:ssXXX,不带毫秒
触发消息的资源页面地址
actor object
触发消息的用户;系统消息可不返回此字段
用户对象 ID
用户名
用户头像地址;未提供时省略
repository object
所属仓库;非仓库消息可不返回此字段
仓库 ID
仓库完整路径,如 owner/repo
仓 库完整显示名称
仓库页面地址
{
"total": 0,
"list": [
{
"id": "string",
"content": "string",
"type": "string",
"unread": true,
"created_at": "2024-07-29T15:51:28.071Z",
"html_url": "string",
"actor": {
"id": "string",
"login": "string",
"avatar_url": "string"
},
"repository": {
"id": 0,
"full_name": "string",
"human_name": "string",
"url": "string"
}
}
]
}