bilibili-API-collect/docs/message/msg.md
wuziqian211 f1c53f92f4 update
2024-03-28 23:21:30 +08:00

64 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 通知消息
## 未读消息数
> https://api.bilibili.com/x/msgfeed/unread
*请求方式GET*
认证方式CookieSESSDATA
本接口不会返回未读的私信数,要获取未读的私信数请查看[未读私信数](private_msg.md#未读私信数)相关说明
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ----------------------------- |
| code | num | 返回值 | 0成功<br />-101账号未登录 |
| message | str | 错误信息 | 默认为0 |
| ttl | num | 1 | |
| data | obj | 信息本体 | |
data 对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------------- | ------------ |
| at | num | 未读at数 | |
| chat | num | 0 | 作用尚不明确 |
| like | num | 未读点赞数 | |
| reply | num | 未读回复数 | |
| sys_msg | num | 未读系统通知数 | |
| up | num | UP主助手信息数 | |
**示例:**
以下信息代表了未读点赞数为10未读回复数为4未读at消息数为3未读系统通知数为2UP主助手信息数为1
```shell
curl 'https://api.bilibili.com/x/msgfeed/unread' \
-b 'SESSDATA=xxx'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"message": "0",
"ttl": 1,
"data": {
"at": 3,
"chat": 0,
"like": 10,
"reply": 4,
"sys_msg": 2,
"up": 1
}
}
```
</details>