QVeris
运行任务
文档目录

启动设备授权

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

名称必填类型说明
scopestring
resourcestring | null
client_idstring | null

可运行示例

bash
curl --request POST \
  --url "https://qveris.ai/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'
typescript
const response = await fetch("https://qveris.ai/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())
python
import json
import requests

response = requests.request(
    "POST",
    "https://qveris.ai/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
200Successful ResponseOAuthDeviceAuthorizationResponse
400OAuth request or grant errorOAuthErrorResponse
401Client authentication or bearer-token errorOAuthErrorResponse
403Subject token has insufficient scopeOAuthErrorResponse
422Validation ErrorHTTPValidationError
429Device Authorization rate limit exceededOAuthRateLimitResponse

成功响应示例

json
{
  "device_code": "string",
  "user_code": "string",
  "verification_uri": "string",
  "verification_uri_complete": "string",
  "expires_in": 1,
  "interval": 1
}

精确契约

相关操作

POST 发现能力 · POST 检查能力 · POST 预检能力 · POST 调用能力

这个页面对你有帮助吗?