POST /oauth/device/authorize
启动设备授权
REST API 概览 · OpenAPI JSON · OpenAPI YAML
| 稳定性 | 认证 | 费用 | Operation ID |
|---|---|---|---|
| 已发布 | Client ID;机密客户端使用 HTTP Basic | 免费 | device_authorize_api_v1_oauth_device_authorize_post |
此操作没有路径或查询参数。
Schema: inline
| 名称 | 必填 | 类型 | 说明 |
|---|---|---|---|
scope | 是 | string | — |
resource | 否 | string | null | — |
client_id | 否 | string | null | — |
curl --request POST \
--url "https://qveris.cn/api/v1/oauth/device/authorize" \
--data-urlencode 'client_id=YOUR_CLIENT_ID' \
--data-urlencode 'scope=openid offline_access' \
--data-urlencode 'resource=YOUR_REGISTERED_RESOURCE_URI'
const response = await fetch("https://qveris.cn/api/v1/oauth/device/authorize", {
method: "POST",
body: new URLSearchParams(Object.entries({
"client_id": "YOUR_CLIENT_ID",
"scope": "openid offline_access",
"resource": "YOUR_REGISTERED_RESOURCE_URI"
}).map(([key, value]) => [key, String(value)])),
})
if (!response.ok) throw new Error(`QVeris request failed: ${response.status}`)
console.log(await response.json())
import json
import requests
response = requests.request(
"POST",
"https://qveris.cn/api/v1/oauth/device/authorize",
data=json.loads(r'''{
"client_id": "YOUR_CLIENT_ID",
"scope": "openid offline_access",
"resource": "YOUR_REGISTERED_RESOURCE_URI"
}'''),
timeout=30,
)
response.raise_for_status()
print(response.json())
| 状态码 | 含义 | Schema |
|---|---|---|
200 | Successful Response | OAuthDeviceAuthorizationResponse |
400 | OAuth request or grant error | OAuthErrorResponse |
401 | Client authentication or bearer-token error | OAuthErrorResponse |
403 | Subject token has insufficient scope | OAuthErrorResponse |
422 | Validation Error | HTTPValidationError |
429 | Device Authorization rate limit exceeded | OAuthRateLimitResponse |
{
"device_code": "string",
"user_code": "string",
"verification_uri": "string",
"verification_uri_complete": "string",
"expires_in": 1,
"interval": 1
}
这个页面对你有帮助吗?