POST
/
api
/
auth
/
device
/
token
轮询 device flow 结果并换取 API Key
curl --request POST \
  --url https://wfapi.yuhe.space/api/auth/device/token \
  --header 'Content-Type: application/json' \
  --data '
{
  "deviceCode": "<string>"
}
'
{
  "errCode": 123,
  "errMessage": "<string>",
  "data": {
    "accessToken": "<string>",
    "apiKey": {
      "id": "<string>",
      "userId": "<string>",
      "name": "<string>",
      "prefix": "<string>",
      "source": "<string>",
      "scopes": [
        "<string>"
      ],
      "createdAt": "2023-11-07T05:31:56Z",
      "createdByUserId": "<string>",
      "expiresAt": "2023-11-07T05:31:56Z",
      "revokedAt": "2023-11-07T05:31:56Z",
      "lastUsedAt": "2023-11-07T05:31:56Z",
      "lastUsedIp": "<string>",
      "userAgent": "<string>"
    },
    "user": {
      "userId": "<string>",
      "email": "jsmith@example.com",
      "displayName": "<string>"
    },
    "expiresAt": "2023-11-07T05:31:56Z"
  }
}

Body

application/json
deviceCode
string
required

Response

批准成功后返回一次性明文 API Key 与账号信息。

errCode
integer
required
errMessage
string
required
Allowed value: ""
data
object
required