2020-04-12 16:15:08 +08:00
|
|
|
|
# 检查昵称是否可注册
|
2020-11-20 20:13:12 +08:00
|
|
|
|
|
|
|
|
|
- [检查昵称](#检查昵称)
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 检查昵称
|
2020-04-12 16:15:08 +08:00
|
|
|
|
|
2023-01-17 15:23:59 +08:00
|
|
|
|
> https://passport.bilibili.com/web/generic/check/nickname
|
2020-04-12 16:15:08 +08:00
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
*请求方式:GET*
|
2020-04-12 16:15:08 +08:00
|
|
|
|
|
2020-11-20 20:13:12 +08:00
|
|
|
|
也可用于判断指定昵称的用户是否存在
|
|
|
|
|
|
2020-06-08 23:06:53 +08:00
|
|
|
|
**url参数:**
|
2020-05-16 00:34:06 +08:00
|
|
|
|
|
2020-04-12 16:15:08 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| -------- | ---- | ----------- | ------ | ---- |
|
2020-06-08 23:06:53 +08:00
|
|
|
|
| nickName | str | 目标昵称 | 必要 | 最长为16字符 |
|
2020-04-12 16:15:08 +08:00
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
2020-04-16 18:47:19 +08:00
|
|
|
|
根对象:
|
|
|
|
|
|
2020-04-12 16:15:08 +08:00
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | --------------------------- |
|
2020-05-16 00:34:06 +08:00
|
|
|
|
| code | num | 状态码 | -400:请求错误<br />-500:服务器端异常<br />**详细说明见下一表格** |
|
2020-04-12 16:15:08 +08:00
|
|
|
|
| message | str | 错误详情 | 若昵称可用,则不返回message |
|
|
|
|
|
|
2020-04-14 23:38:00 +08:00
|
|
|
|
`code`状态码:
|
2020-04-12 16:15:08 +08:00
|
|
|
|
|
2020-04-14 23:38:00 +08:00
|
|
|
|
| 值 | 含义 |
|
|
|
|
|
| ----- | --------------------------------- |
|
|
|
|
|
| 0 | 昵称未被注册 |
|
|
|
|
|
| 2001 | 该昵称已被他人使用 |
|
|
|
|
|
| 40002 | 昵称包含敏感信息 |
|
|
|
|
|
| 40004 | 昵称不可包含除\-和_以外的特殊字符 |
|
2020-05-16 00:34:06 +08:00
|
|
|
|
| 40005 | 昵称过长(超过16字符) |
|
|
|
|
|
| 40006 | 昵称过短(少于2字符) |
|
2020-04-14 23:38:00 +08:00
|
|
|
|
| 40014 | 昵称已存在 |
|
2020-04-12 16:15:08 +08:00
|
|
|
|
|
2020-04-14 23:38:00 +08:00
|
|
|
|
**示例:**
|
2020-04-12 16:15:08 +08:00
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
查询昵称 `xijinping` 是否被使用:
|
2020-04-12 16:15:08 +08:00
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl -G 'https://passport.bilibili.com/web/generic/check/nickname' \
|
2020-07-14 18:44:44 +08:00
|
|
|
|
--data-urlencode 'nickName=xijinping'
|
|
|
|
|
```
|
2020-04-12 16:15:08 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
2020-04-12 16:15:08 +08:00
|
|
|
|
```json
|
|
|
|
|
{
|
2020-05-16 00:34:06 +08:00
|
|
|
|
"code":40002,
|
|
|
|
|
"message":"昵称包含敏感信息"
|
2020-04-12 16:15:08 +08:00
|
|
|
|
}
|
|
|
|
|
```
|
2020-04-14 23:38:00 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
</details>
|
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
查询昵称 `//` 是否被使用:
|
2020-04-14 23:38:00 +08:00
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl -G 'https://passport.bilibili.com/web/generic/check/nickname' \
|
2020-07-14 18:44:44 +08:00
|
|
|
|
--data-urlencode 'nickName=//'
|
|
|
|
|
```
|
2020-04-14 23:38:00 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
2020-04-14 23:38:00 +08:00
|
|
|
|
```json
|
|
|
|
|
{
|
2020-05-16 00:34:06 +08:00
|
|
|
|
"code": 40004,
|
|
|
|
|
"message": "昵称不可包含除-和_以外的特殊字符"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
</details>
|
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
查询昵称 `test0000000000000 ` 是否被使用:
|
2020-05-16 00:34:06 +08:00
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl -G 'https://passport.bilibili.com/web/generic/check/nickname' \
|
2020-07-14 18:44:44 +08:00
|
|
|
|
--data-urlencode 'nickName=test0000000000000 '
|
|
|
|
|
```
|
2020-05-16 00:34:06 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
2020-05-16 00:34:06 +08:00
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 40005,
|
|
|
|
|
"message": "昵称过长"
|
2020-04-14 23:38:00 +08:00
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
</details>
|
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
查询昵称 `0` 是否被使用:
|
2020-04-14 23:38:00 +08:00
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl -G 'https://passport.bilibili.com/web/generic/check/nickname' \
|
2020-07-14 18:44:44 +08:00
|
|
|
|
--data-urlencode 'nickName=0'
|
|
|
|
|
```
|
2020-05-16 00:34:06 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
2020-05-16 00:34:06 +08:00
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 40006,
|
|
|
|
|
"message": "昵称过短"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
</details>
|
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
查询昵称 `test` 是否被使用:
|
2020-05-16 00:34:06 +08:00
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl -G 'https://passport.bilibili.com/web/generic/check/nickname' \
|
2020-07-14 18:44:44 +08:00
|
|
|
|
--data-urlencode 'nickName=test'
|
|
|
|
|
```
|
2020-05-16 00:34:06 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
2020-05-16 00:34:06 +08:00
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code":40014,
|
|
|
|
|
"message":"昵称已存在"
|
|
|
|
|
}
|
|
|
|
|
```
|
2020-04-14 23:38:00 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
</details>
|