Skip to content

认证与授权错误

以下错误码在认证与授权阶段返回。

HTTP 状态码业务码说明
401AUTH_REQUIRED缺少 Authorization 请求头
401AUTH_INVALID认证信息无效
401AUTH_EXPIREDaccess token 已过期
403AUTH_SCOPE_DENIED当前客户端没有访问该接口所需权限

权限不足响应

AUTH_SCOPE_DENIED 会返回当前操作要求的权限。

json
{
  "code": "AUTH_SCOPE_DENIED",
  "message": "This operation requires the device:control permission. Update the API Client permissions in the Developer Console and obtain a new access token.",
  "requestId": "req_001",
  "data": {
    "requiredScope": "device:control"
  }
}

收到该错误后:

  1. 在开发者后台为 API Client 增加 data.requiredScope 指定的权限。
  2. 保存权限配置。
  3. 重新获取 access token。
  4. 使用新 token 重试原操作。

例如只有 device:read 权限时执行继电器开关,会提示需要 device:control

Docs buildVersion v1.3.6-20260720-180213-70
Copyright © 2026 WLTE