capabilities.work

Ensure Feed Exists

A 3-step recipe with Adafruit IO. We can help you get access.

Recipe · 3 steps

Ensure Feed Exists

Get-or-create a feed by key, then write a data point to it.

  1. Attempt to read the feed by its key. A 200 means it already exists; a 404 means it must be created.
  2. Create the feed when the lookup returned 404, using the requested feed key and display name.
  3. Write the data point to the feed, which now exists whether it was found or just created.
What you'll need to have ready
  • username: A valid Adafruit IO username.
  • aioKey: The Adafruit IO API key, sent in the X-AIO-Key header.
  • feedKey: The feed key to look up or create (e.g. "living-room-temp").
  • name: Display name used when the feed has to be created.
  • value: The data point value to write once the feed is known to exist.
For your developer

Arazzo workflow adafruit-io:ensure-feed-exists, 3 operations: getFeed → createFeed → createData. Specs on APIs.io.