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.
Locked
User avatar
experiencestation
 
Posts: 3
Joined: Tue May 25, 2021 2:12 am

Can't figure out the URL syntax...

Post by experiencestation »

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/experien ... /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/experienc ... /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!!!

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

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

Post by experiencestation »

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...

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

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

Post by experiencestation »

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/j ... nkdata=100

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

User avatar
jwcooper
 
Posts: 1004
Joined: Tue May 01, 2012 9:08 pm

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

Post by jwcooper »

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?

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”