Skip to content

Commit

Permalink
feat: 更新部分接口文档的表述 (SocialSisterYi#1049)
Browse files Browse the repository at this point in the history
* feat: add get users info

* 将 SocialSisterYi#983 中对此文件的更改合并到此 PR 中

* fix: typo

* Update info.md

* 更新 danmaku_view_proto.md

* 更新 action.md

* 更新 info.md

* 更新 recommend.md

* 更新 readme.md

* feat: 规范化文档
  • Loading branch information
wuziqian211 authored Jul 6, 2024
1 parent 8d956ba commit 2382b76
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 142 deletions.
2 changes: 1 addition & 1 deletion docs/album/action.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ curl 'https://api.vc.bilibili.com/link_draw/v2/Vote/operate' \
收藏相簿`id=99184721`

```shell
curl 'https:///api.vc.bilibili.com/user_plus/v1/Fav/add' \
curl 'https://api.vc.bilibili.com/user_plus/v1/Fav/add' \
--data-urlencode 'fav_id=99184721' \
--data-urlencode 'biz_type=2' \
--data-urlencode 'csrf_token=xxx' \
Expand Down
2 changes: 1 addition & 1 deletion docs/comment/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@

| 字段 | 类型 | 内容 | 备注 |
| ---- | ---- | -------- | ---------------------------------------- |
| type | num | 是否认证 | -1:无<br />0:个人认证<br />1:机构认证 |
| type | num | 认证类型 | -1:无<br />0:个人认证<br />1:机构认证 |
| desc | str | 认证信息 | 无为空 |

`member`中的`vip`对象:
Expand Down
2 changes: 1 addition & 1 deletion docs/danmaku/danmaku_view_proto.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
| posX | num | X坐标 | 区间:[118-549] |
| posY | num | Y坐标 | 区间:[82-293] |
| icon | str | 按钮图片url | 不应该是关注按钮吗,但这个是圆形的 |
| type | num | 关注按钮类型 | 0:仅关注<br />1:仅三联<br />2:关注+三联 |
| type | num | 关注按钮类型 | 0:仅关注<br />1:仅三连<br />2:关注+三连 |

消息`dmSetting`

Expand Down
104 changes: 31 additions & 73 deletions docs/dynamic/action.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,95 +10,53 @@

**正文参数(multipart/form-data):**

| 参数名 | 类型 | 内容 |
| ---------- | ---- | ------ |
| dynamic_id | num | 动态id |
| csrf_token | str | csrf |
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ---------- | ---- | ------ | ------ | ---- |
| dynamic_id | num | 动态id | 必要 | |
| csrf_token | str | csrf | 必要 | |
| csrf | str | csrf | 必要 | |

**json回复:**

根对象:

| 字段 | 类型 | 内容 |
| ------- | ---- | ----------------- |
| code | num | 0:成功 |
| | | 500404:已经删除过 |
| | | 500406:不是自己的 |
| msg | str | 错误信息 |
| message | str | 和msg一样 |
| data | obj | 未知 |
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | --------------------------------------------------------------------------------------- |
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />500404:已经删除过该动态<br />500406:动态不是自己的 |
| msg | str | 错误信息 | 成功时为空文本 |
| message | str | 错误信息 |`msg` |
| data | obj | 数据本体 | |

<details>
<summary>查看示例</summary>


```bash
curl 'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/rm_dynamic' \
-X POST \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0' \
-H 'Referer: https://t.bilibili.com/' \
-H 'Cookie: SESSDATA=********; bili_jct=de2731532b4ab96bc8536da948932668;' \
--data-raw 'dynamic_id=588320531406678918&csrf_token=de2731532b4ab96bc8536da948932668&csrf=de2731532b4ab96bc8536da948932668'
```

```json
{
"code":0,
"msg":"",
"message":"",
"data": {
"_gt_":0
}
}
```
`data`对象:

</details>

## 删除草稿
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | ---- | ---------------- |
| \_gt\_ | num | 0 | **作用尚不明确** |

> https://api.vc.bilibili.com/dynamic_draft/v1/dynamic_draft/rm_draft
**示例:**

*请求方式:POST*
删除动态`dynamic_id=588320531406678918`

认证方式:Cookie(SESSDATA)

**正文参数(application/x-www-form-urlencoded):**

| 参数名 | 类型 | 内容 |
| ---------- | ---- | -------------- |
| draft_id | num | 定时发送草稿id |
| csrf_token | str | csrf |

**json回复:**

根对象:

| 字段 | 类型 | 内容 |
| ------- | ---- | ---------------------------- |
| code | num | 0:成功<br/>4120015: 系统异常 |
| message | str | 错误信息 |
| ttl | num | 1 |
| data | obj | 空对象 |
```shell
curl 'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/rm_dynamic' \
--data-urlencode 'dynamic_id=588320531406678918' \
--data-urlencode 'csrf_token=xxx' \
--data-urlencode 'csrf=xxx' \
-b 'SESSDATA=xxx'
```

<details>
<summary>查看示例</summary>


```bash
curl -X POST 'https://api.vc.bilibili.com/dynamic_draft/v1/dynamic_draft/rm_draft' \
--data-urlencode 'draft_id=755409289278914611' \
--data-urlencode 'csrf=xxxx'
-b 'SESSDATA=xxxx;' \
```
<summary>查看响应示例:</summary>

```json
{
"code": 0,
"message": "0",
"ttl": 1,
"data": {}
"code": 0,
"msg": "",
"message": "",
"data": {
"_gt_": 0
}
}
```

</details>

Loading

0 comments on commit 2382b76

Please sign in to comment.