返回提交历史
Modified
docs/message/settings.md
+97
-0
XFEstudio/bilibili-API-collect
feat(message/settings): add get user setting
Signed-off-by: 晨叶梦春 <65224318+wuziqian211@users.noreply.github.com>
5df6ad2
代码差异
1 个文件
+97
-0
@@ -1,5 +1,102 @@
1
1
# 消息设置
2
2
3
## 获取用户偏好设置
4
5
> <https://api.vc.bilibili.com/link_setting/v1/link_setting/get>
6
7
*请求方式:GET 或 POST*
8
9
认证方式:Cookie(SESSDATA)
10
11
**url参数(GET)或 正文参数(application/x-www-form-urlencoded,POST):**
12
13
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
14
| ------------------- | ---- | -------------------------------- | ------------ | ------------------------- |
15
| msg_notify | num | 是否显示 “消息提醒” 设置 | 非必要 | 若此项为任意整数,则返回数据中有 `msg_notify` 项 |
16
| show_unfollowed_msg | num | 是否显示 “收起未关注人消息” 设置 | 非必要 | 若此项为任意整数,则返回数据中有 `show_unfollowed_msg` 项 |
17
| build | num | 客户端内部版本号 | 非必要 | 默认为 `0` |
18
| mobi_app | str | 平台标识 | 非必要 | 可为 `web` 等 |
19
| csrf_token | str | CSRF Token(位于cookie) | POST方式必要 | |
20
| csrf | str | CSRF Token(位于cookie) | POST方式必要 | |
21
22
**json回复:**
23
24
根对象:
25
26
| 字段 | 类型 | 内容 | 备注 |
27
| ------- | ---- | -------- | ----------------------------- |
28
| code | num | 返回值 | 0:成功<br />-101:账号未登录 |
29
| msg | str | 错误信息 | 默认为0 |
30
| message | str | 错误信息 | 默认为0 |
31
| ttl | num | 1 | |
32
| data | obj | 信息本体 | |
33
34
`data` 对象:
35
36
| 字段 | 类型 | 内容 | 备注 |
37
| ------------------------ | ---- | -------------------- | --------------------------------------------------------------------------- |
38
| show_unfollowed_msg | num | 收起未关注人消息 | 请求参数 `show_unfollowed_msg` 为整数时显示此项<br />0:不收起<br />1:收起 |
39
| msg_notify | num | 消息提醒 | 请求参数 `msg_notify` 为整数时显示此项<br />1:接收<br />3:不接收 |
40
| set_like | num | 收到的赞提醒(旧) | 0:接收<br />5:不接收 |
41
| set_comment | num | 回复我的提醒(旧) | 0:所有人<br />1:关注的人<br />2:不接受任何消息提醒 |
42
| set_at | num | @ 我的提醒 (旧) | 0:所有人<br />1:关注的人<br />2:不接受任何消息提醒 |
43
| is_group_fold | num | 收起应援团消息 | 0:不收起<br />1:收起 |
44
| should_receive_group | num | 接收应援团消息 | 0:不接收<br />1:接收 |
45
| receive_unfollow_msg | num | 接收未关注人消息 | 前端隐藏此开关<br />0:不接收<br />1:接收 |
46
| followed_reply | num | 被关注回复 | 0:关闭<br />1:开启 |
47
| keys_reply | num | 关键词回复 | 0:关闭<br />1:开启 |
48
| recv_reply | num | 收到消息回复 | 0:关闭<br />1:开启 |
49
| voyage_reply | num | 大航海上船回复 | 0:关闭<br />1:开启 |
50
| recommend_followed_reply | num | 被关注时自动推送作品 | 0:关闭<br />1:开启 |
51
| ai_intercept | num | 私信智能拦截 | 0:关闭<br />1:开启 |
52
| anti_harassment | null | 防骚扰和互动人群设置 | 恒为 `null` |
53
| set_recv_reply | num | 收到回复提醒(新) | 0:所有人<br />1:关注的人<br />2:不接受任何消息提醒 |
54
| set_recv_like | num | 收到喜欢提醒(新) | 0:接收<br />2:不接收 |
55
| set_new_follow | num | 新增粉丝提醒(新) | 0:接收<br />2:不接收 |
56
57
**示例:**
58
59
```shell
60
curl -G 'https://api.vc.bilibili.com/link_setting/v1/link_setting/get' \
61
--data-urlencode 'msg_notify=1' \
62
--data-urlencode 'show_unfollowed_msg=1' \
63
-b 'SESSDATA=xxx'
64
```
65
66
<details>
67
<summary>查看响应示例:</summary>
68
69
```json
70
{
71
"code": 0,
72
"msg": "0",
73
"message": "0",
74
"ttl": 1,
75
"data": {
76
"show_unfollowed_msg": 0,
77
"msg_notify": 1,
78
"set_like": 0,
79
"set_comment": 0,
80
"set_at": 0,
81
"is_group_fold": 0,
82
"should_receive_group": 1,
83
"receive_unfollow_msg": 1,
84
"followed_reply": 1,
85
"keys_reply": 0,
86
"recv_reply": 1,
87
"voyage_reply": 0,
88
"recommend_followed_reply": 1,
89
"ai_intercept": 1,
90
"anti_harassment": null,
91
"set_recv_reply": 0,
92
"set_recv_like": 0,
93
"set_new_follow": 0
94
}
95
}
96
```
97
98
</details>
99
3
100
## 获取系统设置
4
101
5
102
> <https://api.vc.bilibili.com/link_setting/v1/link_setting/get_sys_setting>