GenerateDeviceCode - 生成设备Code

更新时间:
复制为 MD 格式

调用GenerateDeviceCode接口,生成设备流code。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求语法

POST /v2/{instanceId}/{applicationId}/oauth2/device/code HTTP/1.1

路径参数

名称

类型

必填

描述

示例值

instanceId

string

实例 ID。

idaas_ue2jvisn35ea5lmthk267xxxxx

applicationId

string

应用 ID。

app_mkv7rgt4d7i4u7zqtzev2mxxxx

请求参数

名称

类型

必填

描述

示例值

scope

string

scope 范围。

xxx

返回参数

名称

类型

描述

示例值

object

响应结果。

device_code

string

设备码。

xxxxx

user_code

string

用户授权码。

xxxxx

verification_uri

string

检验 uri。

https://example.com/authorize/device

verification_uri_complete

string

完整的检验 uri。

https://example.com/authorize/device?user_code= xxxx

expires_in

integer

有效时长,单位秒

1200

expires_at

integer

失效时间,格式为 Unix 时间戳,单位为秒。

1653288641

interval

integer

请求 token 节点的超时时间,单位秒

5

示例

正常返回示例

JSON格式

{
  "device_code": "xxxxx",
  "user_code": "xxxxx",
  "verification_uri": "https://example.com/authorize/device",
  "verification_uri_complete": "https://example.com/authorize/device?user_code=\nxxxx",
  "expires_in": 1200,
  "expires_at": 1653288641,
  "interval": 5
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情