Please note: Friday June 18 is a holiday celebrating Juneteenth, please allow extra time for your order to arrive and plan accordingly.
0

Can't figure out the URL syntax...
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Can't figure out the URL syntax...

by experiencestation on Tue May 25, 2021 4:48 pm

I cannot, for the life of me, figure out the URL syntax for changing data in an existing feed. I need it to be a simple one-line URL...but I see no examples in the V2 documentation (and the old style syntax doesn't seem to work).

So, say I want to change the latest value of junktest.junkdata for the user experiencestation...it would seem that I need something like:

https://io.adafruit.com/api/v2/experiencestation/feeds/junktest.junkdata/value=100

The documentation says something like this: /api/v2/{username}/groups/{group_key}/feeds/{feed_key}/data, and I've tried every permutation of how to supply the value (quotes, no quotes, quotes on portions, calling it last_value, etc.) .

http://io.adafruit.com/api/v2/experiencestation/groups/junktest/feeds/junkdata/ {what now?}

Does anybody have a suggestion? ...also where/how do I include the x-aio-key thing? If I include it, things seem to break more/differently. I'd prefer for this not to be a public database in the final version. Thanks!!!

experiencestation
 
Posts: 3
Joined: Tue May 25, 2021 2:12 am

Re: Can't figure out the URL syntax...

by experiencestation on Tue May 25, 2021 5:52 pm

Basically, I need the updated version of the information on this page:

https://learn.adafruit.com/adafruit-io/ ... i?view=all

...and yes, I've looked at the v2 documentation, but I can't figure out how to do this simple one-liner that'll alter the feed value (I have an ESP8266 that responds to feed value changes).

So close to having this whole thing working...

experiencestation
 
Posts: 3
Joined: Tue May 25, 2021 2:12 am

Re: Can't figure out the URL syntax...

by experiencestation on Tue May 25, 2021 10:03 pm

The documentation also claims that I could use the v1 API, which means that the example on the page I shared should work, if it's massaged with my group and x-aio-key, but it doesn't.

Something like:

https://io.adafruit.com/api/v1/groups/junktest/send.json?x-aio-key=mumble&junkdata=100

For my purposes, I really need to get a feed value inserted using a GET.

experiencestation
 
Posts: 3
Joined: Tue May 25, 2021 2:12 am

Re: Can't figure out the URL syntax...

by jwcooper on Wed May 26, 2021 11:39 am

This functionality was removed. That guide is outdated and labeled as such. The reason it was removed was due to it being insecure and not something we are comfortable with anymore. Adding the x-aio-key to the url as a parameter potentially causes it to get cached along the way to our system, exposing it to the public.

What is the use case where you need to use a GET request? Maybe there is another approach we could help you with?

jwcooper
 
Posts: 784
Joined: Tue May 01, 2012 9:08 pm

Please be positive and constructive with your questions and comments.