Skip to content

WebSocket 权限范围

WebSocket 使用 API Client 权限。创建 ticket 和执行请求时,服务会验证客户端、应用、账号和设备当前状态。

请求所需权限
session.ping已认证连接
device.state.getdevice:read
device.operation.execute + device.relay.setdevice:control
device.operation.execute + device.rs485.transceivedevice:control
device.operation.execute + device.rs485.baudRate.setdevice:config
device.operation.execute + device.relay.jogConfig.setdevice:config

权限不足时返回:

json
{
  "type": "reply",
  "requestId": "req_relay_001",
  "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.",
  "data": {
    "requiredScope": "device:control"
  }
}

修改 API Client 权限后,应重新获取 access token,再创建新的 WebSocket ticket。不要继续使用修改权限前签发的 token。

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