arazzo: 1.0.1
info:
title: Adafruit IO Build Dashboard with Block
summary: Create a dashboard, add a visualization block to it, then read the block back.
description: >-
Assembles a live dashboard for visualizing feed data. The workflow creates a
dashboard, adds a block (such as a gauge or line chart) bound to one or more
feeds, and reads the block back to confirm it was placed. Every step spells
out its request inline — including the username path parameter and the
X-AIO-Key authentication header. Note: the Dashboard response schema in the
OpenAPI description documents only name, description, key, and blocks, but
the dashboard `id` returned by the create call is required as the
dashboard_id path parameter for block operations, so it is captured here from
the response body. The same applies to the block `id` returned by the create
block call, which is required as the block id path parameter on read.
version: 1.0.0
sourceDescriptions:
- name: blocksApi
url: ../openapi/adafruit-io-blocks-api-openapi.yml
type: openapi
- name: dashboardsApi
url: ../openapi/adafruit-io-dashboards-api-openapi.yml
type: openapi
workflows:
- workflowId: build-dashboard-with-block
summary: Create a dashboard, add a block to it, and read the block back.
description: >-
Provisions a dashboard, creates a visualization block on it bound to a feed,
and fetches the block to verify placement.
inputs:
type: object
required:
- username
- aioKey
- dashboardName
- blockName
- visualType
properties:
username:
type: string
description: A valid Adafruit IO username.
aioKey:
type: string
description: The Adafruit IO API key, sent in the X-AIO-Key header.
dashboardName:
type: string
description: Display name for the new dashboard.
dashboardDescription:
type: string
description: Optional description for the dashboard.
blockName:
type: string
description: Display name for the block added to the dashboard.
visualType:
type: string
description: The block visualization type (e.g. "line_chart", "gauge", "text").
feedId:
type: string
description: Optional feed id to bind the block to (used as block_feeds.feed_id).
steps:
- stepId: createDashboard
description: >-
Create the dashboard that will hold the visualization block.
operationId: createDashboard
parameters:
- name: username
in: path
value: $inputs.username
- name: X-AIO-Key
in: header
value: $inputs.aioKey
requestBody:
contentType: application/json
payload:
name: $inputs.dashboardName
description: $inputs.dashboardDescription
successCriteria:
- condition: $statusCode == 200
outputs:
dashboardId: $response.body#/id
dashboardKey: $response.body#/key
- stepId: addBlock
description: >-
Create a block on the dashboard, binding it to the supplied feed id and
using the requested visualization type.
operationId: createBlock
parameters:
- name: username
in: path
value: $inputs.username
- name: dashboard_id
in: path
value: $steps.createDashboard.outputs.dashboardId
- name: X-AIO-Key
in: header
value: $inputs.aioKey
requestBody:
contentType: application/json
payload:
name: $inputs.blockName
visual_type: $inputs.visualType
block_feeds:
- feed_id: $inputs.feedId
successCriteria:
- condition: $statusCode == 200
outputs:
blockId: $response.body#/id
blockKey: $response.body#/key
- stepId: readBlock
description: >-
Read the block back from the dashboard to confirm it was created and
placed.
operationId: getBlock
parameters:
- name: username
in: path
value: $inputs.username
- name: dashboard_id
in: path
value: $steps.createDashboard.outputs.dashboardId
- name: id
in: path
value: $steps.addBlock.outputs.blockId
- name: X-AIO-Key
in: header
value: $inputs.aioKey
successCriteria:
- condition: $statusCode == 200
outputs:
visualType: $response.body#/visual_type
blockName: $response.body#/name
outputs:
dashboardId: $steps.createDashboard.outputs.dashboardId
dashboardKey: $steps.createDashboard.outputs.dashboardKey
blockId: $steps.addBlock.outputs.blockId
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.