2020-06-24 22:31:01 +08:00
|
|
|
|
# 表情操作
|
|
|
|
|
|
2020-11-20 20:13:12 +08:00
|
|
|
|
- [添加表情包](#添加表情包)
|
|
|
|
|
- [移除表情包](#移除表情包)
|
|
|
|
|
|
|
|
|
|
---
|
2020-06-24 22:31:01 +08:00
|
|
|
|
|
|
|
|
|
## 添加表情包
|
|
|
|
|
|
|
|
|
|
> http://api.bilibili.com/x/emote/package/add
|
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
*请求方式:POST*
|
2020-06-24 22:31:01 +08:00
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA)
|
|
|
|
|
|
2020-06-24 22:31:01 +08:00
|
|
|
|
只能添加有会员权限或已购买的表情包
|
|
|
|
|
|
|
|
|
|
**正文参数( application/x-www-form-urlencoded ):**
|
|
|
|
|
|
2020-07-09 16:34:50 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ---------- | ---- | ------------------------ | ------ | -------------------------------- |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| package_id | num | 表情包id | 必要 | |
|
2020-07-09 16:34:50 +08:00
|
|
|
|
| business | str | 使用场景 | 必要 | reply:评论区<br />dynamic:动态 |
|
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | 必要 | |
|
2020-06-24 22:31:01 +08:00
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />-111:csrf校验失败<br />-400:请求错误<br />-403:访问权限不足 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
2020-07-17 23:50:28 +08:00
|
|
|
|
| ttl | num | 1 | |
|
2020-06-24 22:31:01 +08:00
|
|
|
|
|
|
|
|
|
**示例:**
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
添加id为`25`的表情包,使用场景为评论区
|
2020-06-24 22:31:01 +08:00
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
```shell
|
2020-10-16 19:31:41 +08:00
|
|
|
|
curl 'http://api.bilibili.com/x/emote/package/add' \
|
|
|
|
|
--data-urlencode 'package_id=25' \
|
|
|
|
|
--data-urlencode 'business=reply' \
|
|
|
|
|
--data-urlencode 'csrf=xxx' \
|
2020-07-18 23:56:10 +08:00
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
2020-06-24 22:31:01 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
2020-06-24 22:31:01 +08:00
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
</details>
|
|
|
|
|
|
2020-06-24 22:31:01 +08:00
|
|
|
|
## 移除表情包
|
|
|
|
|
|
|
|
|
|
> http://api.bilibili.com/x/emote/package/remove
|
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
*请求方式:POST*
|
2020-06-24 22:31:01 +08:00
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA)
|
|
|
|
|
|
2020-06-24 22:31:01 +08:00
|
|
|
|
**正文参数( application/x-www-form-urlencoded ):**
|
|
|
|
|
|
2020-07-09 16:34:50 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ---------- | ---- | ------------------------ | ------ | -------------------------------- |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| package_id | num | 表情包id | 必要 | |
|
2020-07-09 16:34:50 +08:00
|
|
|
|
| business | str | 使用场景 | 必要 | reply:评论区<br />dynamic:动态 |
|
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | 必要 | |
|
2020-06-24 22:31:01 +08:00
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />-111:csrf校验失败<br />-400:请求错误<br />-403:访问权限不足 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
2020-07-17 23:50:28 +08:00
|
|
|
|
| ttl | num | 1 | |
|
2020-06-24 22:31:01 +08:00
|
|
|
|
|
|
|
|
|
**示例:**
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
移除id为`25`的表情包,使用场景为评论区
|
2020-06-24 22:31:01 +08:00
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
```shell
|
2020-10-16 19:31:41 +08:00
|
|
|
|
curl 'http://api.bilibili.com/x/emote/package/remove' \
|
|
|
|
|
--data-urlencode 'package_id=25' \
|
|
|
|
|
--data-urlencode 'business=reply' \
|
|
|
|
|
--data-urlencode 'csrf=xxx' \
|
2020-07-18 23:56:10 +08:00
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
2020-06-24 22:31:01 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
2020-06-24 22:31:01 +08:00
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
</details>
|