Adafruit IO REST API
API version: 2.0.0
Auth
ApiKey X-AIO-Key in header | ApiKey X-AIO-Key in query | ApiKey X-AIO-Signature in header
Base URL
https://io.adafruit.com/api/v2
Setup
- 1. Set your API key in the appropriate header
- GET /user -- verify access
- POST /{username}/feeds -- create first feeds
Endpoints
71 endpoints across 3 groups. See references/api-spec.lap for full details.
user
| Method | Path | Description |
|---|
| GET | /user | Get information about the current user |
{username}
| Method | Path | Description |
|---|
| GET | /{username}/throttle | Get the user's data rate limit and current activity level. |
| GET |
/{username}/activities | All activities for current user |
| DELETE | /{username}/activities | All activities for current user |
| GET | /{username}/activities/{type} | Get activities by type for current user |
| GET | /{username}/feeds | All feeds for current user |
| POST | /{username}/feeds | Create a new Feed |
| GET | /{username}/feeds/{feed_key} | Get feed by feed key |
| PUT | /{username}/feeds/{feed_key} | Replace an existing Feed |
| PATCH | /{username}/feeds/{feed_key} | Update properties of an existing Feed |
| DELETE | /{username}/feeds/{feed_key} | Delete an existing Feed |
| GET | /{username}/feeds/{feed_key}/details | Get detailed feed by feed key |
| GET | /{username}/feeds/{feed_key}/data | Get all data for the given feed |
| POST | /{username}/feeds/{feed_key}/data | Create new Data |
| GET | /{username}/feeds/{feed_key}/data/chart | Chart data for current feed |
| POST | /{username}/feeds/{feed_key}/data/batch | Create multiple new Data records |
| GET | /{username}/feeds/{feed_key}/data/previous | Previous Data in Queue |
| GET | /{username}/feeds/{feed_key}/data/next | Next Data in Queue |
| GET | /{username}/feeds/{feed_key}/data/last | Last Data in Queue |
| GET | /{username}/feeds/{feed_key}/data/first | First Data in Queue |
| GET | /{username}/feeds/{feed_key}/data/retain | Last Data in MQTT CSV format |
| GET | /{username}/feeds/{feed_key}/data/{id} | Returns data based on feed key |
| PUT | /{username}/feeds/{feed_key}/data/{id} | Replace existing Data |
| PATCH | /{username}/feeds/{feed_key}/data/{id} | Update properties of existing Data |
| DELETE | /{username}/feeds/{feed_key}/data/{id} | Delete existing Data |
| GET | /{username}/groups | All groups for current user |
| POST | /{username}/groups | Create a new Group |
| GET | /{username}/groups/{group_key} | Returns Group based on ID |
| PUT | /{username}/groups/{group_key} | Replace an existing Group |
| PATCH | /{username}/groups/{group_key} | Update properties of an existing Group |
| DELETE | /{username}/groups/{group_key} | Delete an existing Group |
| POST | /{username}/groups/{group_key}/add | Add an existing Feed to a Group |
| POST | /{username}/groups/{group_key}/remove | Remove a Feed from a Group |
| GET | /{username}/groups/{group_key}/feeds | All feeds for current user in a given group |
| POST | /{username}/groups/{group_key}/feeds | Create a new Feed in a Group |
| POST | /{username}/groups/{group_key}/data | Create new data for multiple feeds in a group |
| GET | /{username}/groups/{group
key}/feeds/{feedkey}/data | All data for current feed in a specific group |
| POST | /{username}/groups/{group
key}/feeds/{feedkey}/data | Create new Data in a feed belonging to a particular group |
| POST | /{username}/groups/{group
key}/feeds/{feedkey}/data/batch | Create multiple new Data records in a feed belonging to a particular group |
| GET | /{username}/dashboards | All dashboards for current user |
| POST | /{username}/dashboards | Create a new Dashboard |
| GET | /{username}/dashboards/{id} | Returns Dashboard based on ID |
| PUT | /{username}/dashboards/{id} | Replace an existing Dashboard |
| PATCH | /{username}/dashboards/{id} | Update properties of an existing Dashboard |
| DELETE | /{username}/dashboards/{id} | Delete an existing Dashboard |
| GET | /{username}/dashboards/{dashboard_id}/blocks | All blocks for current user |
| POST | /{username}/dashboards/{dashboard_id}/blocks | Create a new Block |
| GET | /{username}/dashboards/{dashboard_id}/blocks/{id} | Returns Block based on ID |
| PUT | /{username}/dashboards/{dashboard_id}/blocks/{id} | Replace an existing Block |
| PATCH | /{username}/dashboards/{dashboard_id}/blocks/{id} | Update properties of an existing Block |
| DELETE | /{username}/dashboards/{dashboard_id}/blocks/{id} | Delete an existing Block |
| GET | /{username}/tokens | All tokens for current user |
| POST | /{username}/tokens | Create a new Token |
| GET | /{username}/tokens/{id} | Returns Token based on ID |
| PUT | /{username}/tokens/{id} | Replace an existing Token |
| PATCH | /{username}/tokens/{id} | Update properties of an existing Token |
| DELETE | /{username}/tokens/{id} | Delete an existing Token |
| GET | /{username}/triggers | All triggers for current user |
| POST | /{username}/triggers | Create a new Trigger |
| GET | /{username}/triggers/{id} | Returns Trigger based on ID |
| PUT | /{username}/triggers/{id} | Replace an existing Trigger |
| PATCH | /{username}/triggers/{id} | Update properties of an existing Trigger |
| DELETE | /{username}/triggers/{id} | Delete an existing Trigger |
| GET | /{username}/{type}/{type_id}/acl | All permissions for current user and type |
| POST | /{username}/{type}/{type_id}/acl | Create a new Permission |
| GET | /{username}/{type}/{type_id}/acl/{id} | Returns Permission based on ID |
| PUT | /{username}/{type}/{type_id}/acl/{id} | Replace an existing Permission |
| PATCH | /{username}/{type}/{type_id}/acl/{id} | Update properties of an existing Permission |
| DELETE | /{username}/{type}/{type_id}/acl/{id} | Delete an existing Permission |
webhooks
| Method | Path | Description |
|---|
| POST | /webhooks/feed/:token | Send data to a feed via webhook URL. |
| POST |
/webhooks/feed/:token/raw | Send arbitrary data to a feed via webhook URL. |
Common Questions
Match user requests to endpoints in references/api-spec.lap. Key patterns:
- - "List all user?" -> GET /user
- "List all throttle?" -> GET /{username}/throttle
- "List all activities?" -> GET /{username}/activities
- "Get activity details?" -> GET /{username}/activities/{type}
- "List all feeds?" -> GET /{username}/feeds
- "Create a feed?" -> POST /{username}/feeds
- "Get feed details?" -> GET /{username}/feeds/{feedkey}
- "Update a feed?" -> PUT /{username}/feeds/{feedkey}
- "Partially update a feed?" -> PATCH /{username}/feeds/{feedkey}
- "Delete a feed?" -> DELETE /{username}/feeds/{feedkey}
- "List all details?" -> GET /{username}/feeds/{feedkey}/details
- "List all data?" -> GET /{username}/feeds/{feedkey}/data
- "Create a data?" -> POST /{username}/feeds/{feedkey}/data
- "List all chart?" -> GET /{username}/feeds/{feedkey}/data/chart
- "Create a batch?" -> POST /{username}/feeds/{feedkey}/data/batch
- "List all previous?" -> GET /{username}/feeds/{feedkey}/data/previous
- "List all next?" -> GET /{username}/feeds/{feedkey}/data/next
- "List all last?" -> GET /{username}/feeds/{feedkey}/data/last
- "List all first?" -> GET /{username}/feeds/{feedkey}/data/first
- "List all retain?" -> GET /{username}/feeds/{feedkey}/data/retain
- "Get data details?" -> GET /{username}/feeds/{feedkey}/data/{id}
- "Update a data?" -> PUT /{username}/feeds/{feedkey}/data/{id}
- "Partially update a data?" -> PATCH /{username}/feeds/{feedkey}/data/{id}
- "Delete a data?" -> DELETE /{username}/feeds/{feedkey}/data/{id}
- "List all groups?" -> GET /{username}/groups
- "Create a group?" -> POST /{username}/groups
- "Get group details?" -> GET /{username}/groups/{groupkey}
- "Update a group?" -> PUT /{username}/groups/{groupkey}
- "Partially update a group?" -> PATCH /{username}/groups/{groupkey}
- "Delete a group?" -> DELETE /{username}/groups/{groupkey}
- "Create a add?" -> POST /{username}/groups/{groupkey}/add
- "Create a remove?" -> POST /{username}/groups/{groupkey}/remove
- "List all feeds?" -> GET /{username}/groups/{groupkey}/feeds
- "Create a feed?" -> POST /{username}/groups/{groupkey}/feeds
- "Create a data?" -> POST /{username}/groups/{groupkey}/data
- "List all data?" -> GET /{username}/groups/{groupkey}/feeds/{feedkey}/data
- "Create a data?" -> POST /{username}/groups/{groupkey}/feeds/{feedkey}/data
- "Create a batch?" -> POST /{username}/groups/{groupkey}/feeds/{feedkey}/data/batch
- "List all dashboards?" -> GET /{username}/dashboards
- "Create a dashboard?" -> POST /{username}/dashboards
- "Get dashboard details?" -> GET /{username}/dashboards/{id}
- "Update a dashboard?" -> PUT /{username}/dashboards/{id}
- "Partially update a dashboard?" -> PATCH /{username}/dashboards/{id}
- "Delete a dashboard?" -> DELETE /{username}/dashboards/{id}
- "List all blocks?" -> GET /{username}/dashboards/{dashboardid}/blocks
- "Create a block?" -> POST /{username}/dashboards/{dashboardid}/blocks
- "Get block details?" -> GET /{username}/dashboards/{dashboardid}/blocks/{id}
- "Update a block?" -> PUT /{username}/dashboards/{dashboardid}/blocks/{id}
- "Partially update a block?" -> PATCH /{username}/dashboards/{dashboardid}/blocks/{id}
- "Delete a block?" -> DELETE /{username}/dashboards/{dashboardid}/blocks/{id}
- "List all tokens?" -> GET /{username}/tokens
- "Create a token?" -> POST /{username}/tokens
- "Get token details?" -> GET /{username}/tokens/{id}
- "Update a token?" -> PUT /{username}/tokens/{id}
- "Partially update a token?" -> PATCH /{username}/tokens/{id}
- "Delete a token?" -> DELETE /{username}/tokens/{id}
- "List all triggers?" -> GET /{username}/triggers
- "Create a trigger?" -> POST /{username}/triggers
- "Get trigger details?" -> GET /{username}/triggers/{id}
- "Update a trigger?" -> PUT /{username}/triggers/{id}
- "Partially update a trigger?" -> PATCH /{username}/triggers/{id}
- "Delete a trigger?" -> DELETE /{username}/triggers/{id}
- "List all acl?" -> GET /{username}/{type}/{typeid}/acl
- "Create a acl?" -> POST /{username}/{type}/{typeid}/acl
- "Get acl details?" -> GET /{username}/{type}/{typeid}/acl/{id}
- "Update a acl?" -> PUT /{username}/{type}/{typeid}/acl/{id}
- "Partially update a acl?" -> PATCH /{username}/{type}/{typeid}/acl/{id}
- "Delete a acl?" -> DELETE /{username}/{type}/{type_id}/acl/{id}
- "Create a :token?" -> POST /webhooks/feed/:token
- "Create a raw?" -> POST /webhooks/feed/:token/raw
- "How to authenticate?" -> See Auth section
Response Tips
- - Check response schemas in references/api-spec.lap for field details
- List endpoints may support pagination; check for limit, offset, or cursor params
- Create/update endpoints typically return the created/updated object
CLI
CODEBLOCK0
References
- - Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas
Generated from the official API spec by LAP
Adafruit IO REST API
API版本: 2.0.0
认证
请求头中的ApiKey X-AIO-Key | 查询参数中的ApiKey X-AIO-Key | 请求头中的ApiKey X-AIO-Signature
基础URL
https://io.adafruit.com/api/v2
设置
- 1. 在相应的请求头中设置您的API密钥
- GET /user -- 验证访问权限
- POST /{username}/feeds -- 创建第一个数据流
端点
共71个端点,分布在3个组中。完整详情请参见references/api-spec.lap。
user
{username}
| 方法 | 路径 | 描述 |
|---|
| GET | /{username}/throttle | 获取用户的数据速率限制和当前活动级别 |
| GET |
/{username}/activities | 当前用户的所有活动 |
| DELETE | /{username}/activities | 当前用户的所有活动 |
| GET | /{username}/activities/{type} | 按类型获取当前用户的活动 |
| GET | /{username}/feeds | 当前用户的所有数据流 |
| POST | /{username}/feeds | 创建新的数据流 |
| GET | /{username}/feeds/{feed_key} | 按数据流键获取数据流 |
| PUT | /{username}/feeds/{feed_key} | 替换现有数据流 |
| PATCH | /{username}/feeds/{feed_key} | 更新现有数据流的属性 |
| DELETE | /{username}/feeds/{feed_key} | 删除现有数据流 |
| GET | /{username}/feeds/{feed_key}/details | 按数据流键获取详细数据流 |
| GET | /{username}/feeds/{feed_key}/data | 获取指定数据流的所有数据 |
| POST | /{username}/feeds/{feed_key}/data | 创建新数据 |
| GET | /{username}/feeds/{feed_key}/data/chart | 当前数据流的图表数据 |
| POST | /{username}/feeds/{feed_key}/data/batch | 创建多条新数据记录 |
| GET | /{username}/feeds/{feed_key}/data/previous | 队列中的上一条数据 |
| GET | /{username}/feeds/{feed_key}/data/next | 队列中的下一条数据 |
| GET | /{username}/feeds/{feed_key}/data/last | 队列中的最后一条数据 |
| GET | /{username}/feeds/{feed_key}/data/first | 队列中的第一条数据 |
| GET | /{username}/feeds/{feed_key}/data/retain | MQTT CSV格式的最后一条数据 |
| GET | /{username}/feeds/{feed_key}/data/{id} | 根据数据流键返回数据 |
| PUT | /{username}/feeds/{feed_key}/data/{id} | 替换现有数据 |
| PATCH | /{username}/feeds/{feed_key}/data/{id} | 更新现有数据的属性 |
| DELETE | /{username}/feeds/{feed_key}/data/{id} | 删除现有数据 |
| GET | /{username}/groups | 当前用户的所有分组 |
| POST | /{username}/groups | 创建新分组 |
| GET | /{username}/groups/{group_key} | 根据ID返回分组 |
| PUT | /{username}/groups/{group_key} | 替换现有分组 |
| PATCH | /{username}/groups/{group_key} | 更新现有分组的属性 |
| DELETE | /{username}/groups/{group_key} | 删除现有分组 |
| POST | /{username}/groups/{group_key}/add | 将现有数据流添加到分组 |
| POST | /{username}/groups/{group_key}/remove | 从分组中移除数据流 |
| GET | /{username}/groups/{group_key}/feeds | 指定分组中当前用户的所有数据流 |
| POST | /{username}/groups/{group_key}/feeds | 在分组中创建新数据流 |
| POST | /{username}/groups/{group_key}/data | 为分组中的多个数据流创建新数据 |
| GET | /{username}/groups/{group
key}/feeds/{feedkey}/data | 指定分组中当前数据流的所有数据 |
| POST | /{username}/groups/{group
key}/feeds/{feedkey}/data | 在属于特定分组的数据流中创建新数据 |
| POST | /{username}/groups/{group
key}/feeds/{feedkey}/data/batch | 在属于特定分组的数据流中创建多条新数据记录 |
| GET | /{username}/dashboards | 当前用户的所有仪表盘 |
| POST | /{username}/dashboards | 创建新仪表盘 |
| GET | /{username}/dashboards/{id} | 根据ID返回仪表盘 |
| PUT | /{username}/dashboards/{id} | 替换现有仪表盘 |
| PATCH | /{username}/dashboards/{id} | 更新现有仪表盘的属性 |
| DELETE | /{username}/dashboards/{id} | 删除现有仪表盘 |
| GET | /{username}/dashboards/{dashboard_id}/blocks | 当前用户的所有区块 |
| POST | /{username}/dashboards/{dashboard_id}/blocks | 创建新区块 |
| GET | /{username}/dashboards/{dashboard_id}/blocks/{id} | 根据ID返回区块 |
| PUT | /{username}/dashboards/{dashboard_id}/blocks/{id} | 替换现有区块 |
| PATCH | /{username}/dashboards/{dashboard_id}/blocks/{id} | 更新现有区块的属性 |
| DELETE | /{username}/dashboards/{dashboard_id}/blocks/{id} | 删除现有区块 |
| GET | /{username}/tokens | 当前用户的所有令牌 |
| POST | /{username}/tokens | 创建新令牌 |
| GET | /{username}/tokens/{id} | 根据ID返回令牌 |
| PUT | /{username}/tokens/{id} | 替换现有令牌 |
| PATCH | /{username}/tokens/{id} | 更新现有令牌的属性 |
| DELETE | /{username}/tokens/{id} | 删除现有令牌 |
| GET | /{username}/triggers | 当前用户的所有触发器 |
| POST | /{username}/triggers | 创建新触发器 |
| GET | /{username}/triggers/{id} | 根据ID返回触发器 |
| PUT | /{username}/triggers/{id} | 替换现有触发器 |
| PATCH | /{username}/triggers/{id} | 更新现有触发器的属性 |
| DELETE | /{username}/triggers/{id} | 删除现有触发器 |
| GET | /{username}/{type}/{type_id}/acl | 当前用户和类型的所有权限 |
| POST | /{username}/{type}/{type_id}/acl | 创建新权限 |
| GET | /{username}/{type}/{type_id}/acl/{id} | 根据ID返回权限 |
| PUT | /{username}/{type}/{type_id}/acl/{id} | 替换现有权限 |
| PATCH | /{username}/{type}/{type_id}/acl/{id} | 更新现有权限的属性 |
| DELETE | /{username}/{type}/{type_id}/acl/{id} | 删除现有权限 |
webhooks
| 方法 | 路径 | 描述 |
|---|
| POST | /webhooks/feed/:token | 通过webhook URL向数据流发送数据 |
| POST |
/webhooks/feed/:token/raw | 通过webhook URL向数据流发送任意数据 |
常见问题
将用户请求与references/api-spec.lap中的端点匹配。关键模式:
- - 列出所有用户? -> GET /user
- 列出所有限流? -> GET /{username}/throttle
- 列出所有活动? -> GET /{username}/activities
- 获取活动详情? -> GET /{username}/activities/{type}
- 列出所有数据流? -> GET /{username}/feeds
- 创建数据流? -> POST /{username}/feeds
- 获取数据流详情? -> GET /{username}/feeds/{feedkey}
- 更新数据流? -> PUT /{username}/feeds/{feedkey}
- 部分更新数据流? -> PATCH /{username}/feeds/{feedkey}
- 删除数据流? -> DELETE /{username}/feeds/{feedkey}
- 列出所有详情? -> GET /{username}/feeds/{feedkey}/details
- 列出所有数据? -> GET /{username}/feeds/{feedkey}/data
- 创建数据? -> POST /{username}/feeds/{feedkey}/data
- 列出所有图表? -> GET /{username}/feeds/{feedkey}/data