所需 OAuth scope:domain:write
添加域名到白名单(状态 pending),成功返回 HTTP 201。中文域名会转换为 punycode 存储;不允许 localhost/本地域名;同一域名全局只能被一个用户添加。返回的验证信息有效期 24 小时:需在 DNS 中为 verification_subdomain 添加 TXT 记录,值为 verification_token,然后调用验证接口。若支持 Domain Connect,会返回 domain_connect_url(一键配置 DNS),否则为空字符串。验证通过后,该域名及其子域名均可用于 HTTP/HTTPS 隧道。
鉴权:OAuth2 Access Token,Authorization: Bearer {{oauthAccessToken}}
OAuth2:支持 OAuth2 Access Token,需要 scope domain:write
错误响应:
| code | msg |
|---|---|
| 401 | authorization header is missing |
| 401 | invalid token |
| 403 | OAuth2权限不足,需要以下权限之一: domain:write |
| 400 | 请求参数错误: <校验错误> |
| 400 | 域名格式不正确 |
| 400 | 不允许使用localhost或本地域名 |
| 400 | 您已添加过此域名 |
| 400 | 该域名已被其他用户添加 |