This commit is contained in:
晨叶梦春 2025-04-20 17:09:21 +08:00
parent 0c9c2da126
commit f52ac24e26

View File

@ -2,7 +2,7 @@
## 兑换卡券
> https://api.bilibili.com/x/vip/privilege/receive
> <https://api.bilibili.com/x/vip/privilege/receive>
*请求方式POST*
@ -10,28 +10,28 @@
**正文参数 (application/x-www-form-urlencoded)**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|------|-----|-----------------------|-------------|--------------------------------------------------------------------------------------|
| type | num | 兑换类型 | 必要 | 1B币券<br />2会员购优惠券<br />3漫画福利券<br />4会员购包邮券<br/>5漫画商城优惠券<br/>6装扮体验卡<br/>7课堂优惠券 |
| csrf | str | CSRF Token (位于cookie) | Cookie 方式必要 | |
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ------ | ---- | ----------------------- | ------ | ------------------------------------------------------------------------------------ |
| type | num | 兑换类型 | 必要 | 1B币券<br />2会员购优惠券<br />3漫画福利券<br />4会员购包邮券<br />5漫画商城优惠券<br />6装扮体验卡<br />7课堂优惠券 |
| csrf | str | CSRF Token (位于cookie) | 必要 | |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
|---------|-----|------|---------------------------------------------------------------------------------------------------|
| code | num | 返回值 | -101账号未登录<br />-111csrf 校验失败<br />-400请求错误<br />69800网络繁忙 请稍后再试<br />69801你已领取过该权益<br />0成功 |
| message | str | 错误信息 | |
| ttl | num | 1 | |
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------------------------------------------- |
| code | num | 返回值 | 0成功<br />-101账号未登录<br />-111csrf 校验失败<br />-400请求错误<br />69800网络繁忙 请稍后再试<br />69801你已领取过该权益 |
| message | str | 错误信息 | 成功时为`0` |
| ttl | num | 1 | |
**示例:**
```shell
curl 'https://api.bilibili.com/x/vip/privilege/receive' \
-b 'SESSDATA=xxx' \
--data-urlencode 'type=1' \
--data-urlencode 'csrf=xxx'
-b 'SESSDATA=xxx' \
--data-urlencode 'type=1' \
--data-urlencode 'csrf=xxx'
```
<details>
@ -49,7 +49,7 @@ curl 'https://api.bilibili.com/x/vip/privilege/receive' \
## 大会员每日经验
> https://api.bilibili.com/x/vip/experience/add
> <https://api.bilibili.com/x/vip/experience/add>
*请求方式POST*
@ -57,39 +57,55 @@ curl 'https://api.bilibili.com/x/vip/privilege/receive' \
**正文参数 (application/x-www-form-urlencoded)**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|------|-----|-----------------------|-------------|--------------------------------------------------------------------------------------|
| csrf | str | CSRF Token (位于cookie) | Cookie 方式必要 | |
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ------ | ---- | ----------------------- | ------ | ---- |
| csrf | str | CSRF Token (位于cookie) | 必要 | |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
|---------|-----|------|---------------------------------------------------------------------------------------------------|
| code | num | 返回值 | -101账号未登录<br />-111csrf 校验失败<br />69198用户经验已经领取<br />6034007请求频繁,请稍后再试<br />0成功 |
| message | str | 错误信息 | ` |
| ttl | num | 1 | |
| data | obj | | 信息本体 |
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ---------------------------------------------------------------------------------------------- |
| code | num | 返回值 | 0成功<br />-101账号未登录<br />-111csrf 校验失败<br />69198用户经验已经领取<br />6034007请求频繁,请稍后再试 |
| message | str | 错误信息 | 成功时为`0` |
| ttl | num | 1 | |
| data | obj | 信息本体 | |
**`data`对象:**
`data`对象:
| 字段 | 类型 | 内容 | 备注 |
| ------------------ | ------------------------------- | -------------------- | ---------------------------------------------- |
| type | num | 0 | |
| is_grant | bool | | 暂时发现 code 为 0 时为 `true` |
| 字段 | 类型 | 内容 | 备注 |
| -------- | ---- | ------------ | ---------------- |
| type | num | 0 | **作用尚不明确** |
| is_grant | bool | 是否领取成功 | |
**示例:**
```shell
curl 'https://api.bilibili.com/x/vip/experience/add' \
-b 'SESSDATA=xxx' \
--data-urlencode 'csrf=xxx'
-b 'SESSDATA=xxx' \
--data-urlencode 'csrf=xxx'
```
<details>
<summary>查看响应示例:</summary>
当经验领取成功时:
```json
{
"code": 0,
"message": "0",
"ttl": 1,
"data": {
"type": 0,
"is_grant": true
}
}
```
当经验已经领取过时:
```json
{
"code": 69198,