Ensure Feed Exists
A 3-step recipe with Adafruit IO. We can help you get access.
Recipe · 3 steps
Ensure Feed Exists
with Adafruit IO
Get-or-create a feed by key, then write a data point to it.
- Attempt to read the feed by its key. A 200 means it already exists; a 404 means it must be created.
- Create the feed when the lookup returned 404, using the requested feed key and display name.
- 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.