简介
概述
Aqara Studio API提供了一套丰富的接口,支持用户高效、安全地访问和管理 Aqara Studio 内的设备、空间与自动化相关的数据。通过这些 API,用户可以实现空间和设备的查询、设备的远程控制、Trait 功能点的读取与下发,以及自动化规则的创建、查询、更新和删除等操作。无论是进行设备管理还是构建自动化场景,Studio API都能为开发者提供基础能力,助力快速集成和扩展 Aqara 平台的数据与服务。
HTTP API 列表
提示
在阅读各 HTTP API 文档之前,务必确认您已阅读如下文档:
- HTTP API 入门:了解 Aqara Studio HTTP API 的请求(HTTP 方法、端点(支持 Aqara Studio 的本机 IP 和远程访问地址)、请求头、认证、参数)和响应(响应状态码、响应体)要素。
- 在线体验 HTTP API:学习如何在文档页面中在线调试 HTTP API,方便快捷地测试和验证 API 功能。
- 使用 Postman 调测:学习如何使用 Postman 调测 Aqara Studio API。
空间
| 功能 | API 端点 | 请求方法 |
|---|---|---|
| 查询空间列表 | /open/api/v1/spaces | GET |
| 创建空间 | /open/api/v1/spaces | POST |
| 修改空间名称 | /open/api/v1/spaces/name | POST |
网关
| 功能 | API 端点 | 请求方法 |
|---|---|---|
| 查询网关列表 | /open/api/v1/gateways | GET |
| 网关按入子设备 | /open/api/v1/gateways/subdevices/join | POST |
| 停止网关子设备入网 | /open/api/v1/gateways/subdevices/join/stop | POST |
| 获取设备绑定结果 | /open/api/v1/gateways/subdevices/bindResult | POST |
设备
| 功能 | API 端点 | 请求方法 |
|---|---|---|
| 查询设备类型列表 | /open/api/v1/devices/types | GET |
| 查询设备信息列表 | /open/api/v1/devices | GET |
| 查询设备模型定义 | /open/api/v1/devices/definitions | GET |
| 通过 Trait 控制设备 | /open/api/v1/devices/trait/execute | POST |
| 查询 Trait 值 | /open/api/v1/devices/trait/read | POST |
| 通过 Command 控制设备 | /open/api/v1/devices/command/execute | POST |
| 向设备下发 Command 并等待响应 | /open/api/v1/devices/command/execute/await | POST |
| 删除设备点位 | /open/api/v1/devices/points/delete | POST |
| 添加虚拟设备 | /open/api/v1/virtual-devices | POST |
| 设备解绑 | /open/api/v1/devices/unbind | POST |
自动化
| 功能 | API 端点 | 请求方法 |
|---|---|---|
| 查询所有支持自动化的设备功能点 | /open/api/v1/automations/capabilities | GET |
| 创建自动化 | /open/api/v1/automations | POST |
| 查询自动化列表 | /open/api/v1/automations | GET |
| 查询自动化详情 | /open/api/v1/automations/<automationId> | GET |
| 编辑自动化 | /open/api/v1/automations/<automationId> | PATCH |
| 批量更新自动化状态 | /open/api/v1/automations/status | POST |
| 批量更新自动化关联空间 | /open/api/v1/automations/space | POST |
| 删除自动化 | /open/api/v1/automations/delete | POST |
| 获取手动触发器列表 | /open/api/v1/automations/manual-triggers | GET |
| 执行手动触发器 | /open/api/v1/automations/manual-triggers/execute | POST |
Studio
| 功能 | API 端点 | 请求方法 |
|---|---|---|
| 获取 Studio 统计信息 | /open/api/v1/studio/statistics | GET |
WebSocket API
除 HTTP 接口外,AqaraLife Studio 还提供基于 WebSocket 的订阅推送能力,适用于实时接收 Trait 值变化和对象事件。若您希望直接在文档页面里调试连接、鉴权、心跳和订阅流程,请访问 WebSocket API Playground。