I am stuck in a huge problem and i have very less time to complete my Final Year Project. My Question is : I want to send some data or value to a feed of io.adafruit through URL, mean when i enter a URL in the Browser, it just send a value to the feed. For Example: https://io.adafruit.com/SOME_Value PLEASE HELP ME
2 Answers
Adafruit IO's API documentation makes it quite clear how to add data using HTTP.
You cannot do it by entering a URL in a web browser. The IO API requires a custom header field, X-AIO-Key, which contains the Adafruit IO API key. There's no way to add this header field when you enter a URL from a browser.
You can, however, use a command-line utility, like curl
. The API documentation is really clear about this and shows examples, like so:
curl -F 'value=42' -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/feeds/{feed_key}/data
Here you'd replace io_key
with the API key, username
with the Adafruit IO username on the account and feed_key
with the variable you're trying to set, and 42
with the value you're setting it to.

- 6,218
- 3
- 16
- 12
-
Hello Sir. Sir i read this documentation several times but the solution is zero..... Sir i want to send a 0 or 1 value to Adafruit.io feed and my esp32 reads that value, and behalf of that value the esp32 switch on or off the relay. I develop a android app, in which i have two Buttons ON and OFF. I want when i click OFF button, the app send 0 to Adafruit.io, when i click ON, the app send 1 to Adafruit.io. – SYED ASAD ABBAS May 30 '19 at 23:17
-
Follow the documentation at the link I gave you above. There's nothing useful I can add to that; they explain how to access their API. You'll need to have code in your Android app that does what they say in the documentation. – romkey May 31 '19 at 19:53
-
OK sir i will do the same, but there are some problems like, i am en Electronic Engineer and i know how to code in android, it means i also know java and android. The thing i dont know is what is curl,http. I tried your given URL in my browser with my API key and user name, but the browser says there is some thing wrong with this URL. so it means i done some thing wrong. if i will give you my user name and api key and the feed name, than can you give me the exact string? – SYED ASAD ABBAS May 31 '19 at 21:20
-
i read several time this documentation but i got nothing. because in the documentation they nothing enplane any thing, i tried 2 3 universities for some help but they said, we dont have any knowledge about your project field or in io.adafruit. And then my mind click about this site, and i found you. you are the only one who i talked and you have the knowledge about my project. – SYED ASAD ABBAS May 31 '19 at 21:30
-
Ok sir, i read about cURL, and now i have some knowledge aboit cURL, now i got you. Just i have to use your given string, which is also given in the documentation. curl -F...../data, just i have to change feed name, iokey, and user name. Thanxxx, today i will try this method. – SYED ASAD ABBAS Jun 02 '19 at 01:16
-
In fairness to Syed, they do not once in their documentation have an actual example. They have a lot of what you posted above, which is not an actual example - it's incomplete in that they don't show an actual line with io_key, username, and feed_key filled in. It's important because if you try actual values, it doesn't work. There's a bit of magic in the formatting or something that they don't spell out. Further, they never actually say what a "feed_key" is. – user3224303 Sep 02 '21 at 19:23
Adafruit doesn't accept underscore characters in the feed ID replace it with "-" and it may work. Refer the real feed URL on their site.