From 2f57550ac457a9909c845f8261ddcc3925da1a97 Mon Sep 17 00:00:00 2001 From: Tyrael Date: Sun, 14 Nov 2021 20:04:25 +1100 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E4=BC=9A=E5=91=98=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E5=85=91=E6=8D=A2=E7=9B=B8=E5=85=B3API=20(#269)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update info.md * Update info.md * Update info.md * Update info.md * Update info.md * Update info.md * add user api under live folder * Update info.md * Update user.md * test index * text index * Update README.md * text indexs * update indexs * update Index * update index * update index * update index * update index * update index * 稍微建设了一下目录 * 稍微建设了一下目录 * add vip * 添加大会员福利兑换相关API --- .gitignore | 3 +- README.md | 3 +- live/info.md | 1 + live/user.md | 11 ++++-- user/vip.md | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 user/vip.md diff --git a/.gitignore b/.gitignore index 0464b72a0c..7c3d02b3da 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -mkdocs/html/* \ No newline at end of file +mkdocs/html/* +README.md diff --git a/README.md b/README.md index b6cc3850ad..c0b7805a97 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ PS:所有http协议地址均可使用https,文档中为了统一写作`http` - [个人空间](user/space.md)x - [检查昵称是否可注册](user/check_nickname.md)√ - [用户注册](user/register.md) + - [大会员福利兑换](user/vip.md) - [视频](video) - [视频分区一览(分区代码)](video/video_zone.md)√ - [基本信息](video/info.md)√ @@ -281,4 +282,4 @@ B站空间: - [uw-labs/bloomrpc](/~https://github.com/uw-labs/bloomrpc): GUI Client for GRPC Services -- [grpc/grpc](/~https://github.com/grpc/grpc): The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) +- [grpc/grpc](/~https://github.com/grpc/grpc): The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) \ No newline at end of file diff --git a/live/info.md b/live/info.md index 57afdcedf0..2f2b9e3a2d 100644 --- a/live/info.md +++ b/live/info.md @@ -3,6 +3,7 @@ - [获取用户对应的直播间状态](#获取用户对应的直播间状态) - [获取房间页初始化信息](#获取房间页初始化信息) - [获取主播信息](#获取主播信息) +- [批量查询直播间状态](#批量查询直播间状态) --- diff --git a/live/user.md b/live/user.md index bae80bc9b7..ff0ede3bcb 100644 --- a/live/user.md +++ b/live/user.md @@ -120,6 +120,13 @@ | mobile_verify | num | | | | official_verify | obj | 认证信息 | | +**示例:** + +```shell +curl https://api.live.bilibili.com/fans_medal/v5/live_fans_medal/iApiMedal \ +-b "SESSDATA=xxx" +``` +
查看响应示例: @@ -133,7 +140,7 @@ "count": 19, "fansMedalList": [ { - "uid": 3831650, + "uid": 1, "target_id": 3821157, "medal_id": 283582, "score": 16031, @@ -206,7 +213,7 @@ "roomid": 21692711 } ], - "name": "藍地球", + "name": "xxx", "pageinfo": { "totalpages": 2, "curPage": 2 diff --git a/user/vip.md b/user/vip.md new file mode 100644 index 0000000000..ee4e4f8d2d --- /dev/null +++ b/user/vip.md @@ -0,0 +1,99 @@ +# 大会员兑换福利 + +- [兑换状态查询](#兑换状态查询) +- [兑换](#兑换) + +--- + +## 兑换状态查询 + +> https://api.bilibili.com/x/vip/privilege/my + +*请求方式:GET* + +认证方式:Cookie(SESSDATA)或APP + +**json回复:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| ------- | ---- | -------- | --------------------------- | +| code | num | 状态码 | -400:请求错误
0:成功 | +| message | str | 错误详情 | | +| data | obj | 信息本体 | | + +`data`对象: + +| 字段 | 类型 | 内容 | 备注 | +| ----- | -------|----------------|------ | +| list | 数组 | 信息本体 | | + +`list`数组: + +| 字段 | 类型 | 内容 | 备注 | +| ----- | -------|-----------------|------ | +| 0 | obj | B币兑换状态 | | +| 1 | obj | 会员购优惠券兑换状态 | | + +`list内`对象: + +| 字段 | 类型 | 内容 | 备注 | +| -------------- | -----|------------------|------ | +| type | num | 1 或 2 | 1:B币
2:会员购优惠券 | +| status | num | 兑换状态 | 0:当月未兑换
1:已兑换 | +| expire_time | num | 当月过期时间 | 当月月底 | + + +**示例:** + +```shell +curl -G 'https://api.bilibili.com/x/vip/privilege/my' \ +``` + +
+查看响应示例: + +```json +{ + "code":0, + "message":"0", + "ttl":1, + "data":{ + "list":[ + {"type":1,"state":1,"expire_time":1638287999}, + {"type":2,"state":1,"expire_time":1638287999} + ] + } +} +``` + +
+ + +## 兑换 +> https://api.bilibili.com/x/vip/privilege/my + +*请求方式:POST* + +认证方式:Cookie(SESSDATA) +注意:请求头中的Origin字段必须为"https://www.bilibili.com/" + + +**正文参数:** + +| 参数名 | 类型 | 内容 | 必要性 | 备注 | +| ---------- | ---- | ---------- | -------- | ---------------------- | +| type | num | 1 或 2 | 必要 | 1:B币
2:会员购优惠券 | +| csrf | num | CSRF token | 必要 | Cookie bili_jct字段 | + +**示例:** + +```shell +curl -G 'https://api.bilibili.com/x/vip/privilege/my' \ +-H "Origin: https://www.bilibili.com/" \ +-d "{\"type\": 1, \"csrf\": csrf_token}" +``` + +**响应:** +无响应 \ No newline at end of file