Closed thejunglejim closed 4 months ago
Finally the penny dropped. A feed can belong to more than one group but it is still the same feed. The group designation is just a tag for a feed. Thanks @tyeth for the help and explanation.
This issue is now closed as both work as expected.
Using the
add_feed_to_group()
call is NOT working - It gives the error:Adafruit IO Error 404: not found - API documentation can be found at https://io.adafruit.com/api/docs
I looked at the code in the library
adafruit_io.py
and it seems fine but I'm no expert ;-)The docs say it will add an existing feed to a group. https://docs.circuitpython.org/projects/adafruitio/en/latest/api.html#adafruit_io.adafruit_io.IO_HTTP.add_feed_to_group It seems to create the correct path/url
When using Curl to call the API directly, it does do something a little strange. It creates a brand new feed under the specified group i.e. If I have a feed called
test
under my general feeds, it will create a new feed called test under the group I specify. I will now have twotest
feeds.curl -F 'feed_key=test' -H "X-AIO-Key: XXX" https://io.adafruit.com/api/v2/XXX/groups/envsensors/add
I believe the bug is in the API. It wants a feed that already exists .... but then goes and creates a new feed in the group regardless. Now you have two feeds with the same name: one in general feeds and one in the group specified. Calling that API without a feed existing in the general feeds, throws an error too.