0

API v2 .../data/last not working?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

API v2 .../data/last not working?

by thayes on Thu May 03, 2018 9:44 am

The API says use this to fetch all data:
https://io.adafruit.com/api/v2/{username}/feeds/{feed_key}/data

And this to fetch the most recent entry:
https://io.adafruit.com/api/v2/{username}/feeds/{feed_key}/data/last

The first one work for me, and I get a big array of values. The second one results in this error:
{"error":"not found - API documentation can be found at https://io.adafruit.com/api/docs"}

Since the only difference between the two calls is appending "/last" to the URL I'm pretty sure that it isn't a bug in my code, an authentication problem (its a public feed also), etc.

What's going on? Is this a bug? Is the API documentation incorrect? Am I misunderstanding something?

thayes
 
Posts: 15
Joined: Mon Apr 04, 2016 5:36 pm

Re: API v2 .../data/last not working?

by thayes on Thu May 03, 2018 9:50 am

Maybe I just answered my own question. Although it is a public feed I can't request ../data/last without authenticating?

This works and gives me the last point:
https://io.adafruit.com/api/v2/{username}/feeds/{feed_key}/data/last?X-AIO-Key=blah

An unauthenticated user can pull *all* data from a public feed but not individual data points?

thayes
 
Posts: 15
Joined: Mon Apr 04, 2016 5:36 pm

Please be positive and constructive with your questions and comments.