arazzo: 1.0.1
info:
title: Adafruit IO Create and Verify Trigger
summary: Create a reactive trigger for the user, then read it back to confirm it exists.
description: >-
Sets up a reactive automation in Adafruit IO. The workflow creates a trigger
by name and then reads it back by id to confirm it was registered, giving an
integration a verified handle to the trigger it just created. Every step
spells out its request inline — including the username path parameter and the
X-AIO-Key authentication header. Note: the Trigger response schema in the
OpenAPI description documents only the `name` field, but the trigger `id`
returned by the create call is required as the id path parameter on read, so
it is captured here from the response body.
version: 1.0.0
sourceDescriptions:
- name: triggersApi
url: ../openapi/adafruit-io-triggers-api-openapi.yml
type: openapi
workflows:
- workflowId: create-and-verify-trigger
summary: Create a trigger and read it back by its id.
description: >-
Registers a new trigger for the user, then fetches it by id to verify the
creation succeeded.
inputs:
type: object
required:
- username
- aioKey
- name
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.
name:
type: string
description: The name of the trigger to create.
steps:
- stepId: createTrigger
description: >-
Create a new trigger for the user with the supplied name.
operationId: createTrigger
parameters:
- name: username
in: path
value: $inputs.username
- name: X-AIO-Key
in: header
value: $inputs.aioKey
requestBody:
contentType: application/json
payload:
name: $inputs.name
successCriteria:
- condition: $statusCode == 200
outputs:
triggerId: $response.body#/id
triggerName: $response.body#/name
- stepId: verifyTrigger
description: >-
Read the trigger back by its id to confirm it was registered.
operationId: getTrigger
parameters:
- name: username
in: path
value: $inputs.username
- name: id
in: path
value: $steps.createTrigger.outputs.triggerId
- name: X-AIO-Key
in: header
value: $inputs.aioKey
successCriteria:
- condition: $statusCode == 200
outputs:
verifiedName: $response.body#/name
outputs:
triggerId: $steps.createTrigger.outputs.triggerId
verifiedName: $steps.verifyTrigger.outputs.verifiedName
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
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. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.