Getting the last data feed

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
cheerlights
 
Posts: 2
Joined: Tue Nov 09, 2021 4:11 pm

Getting the last data feed

Post by cheerlights »

Hi. I am working on a CheerLights feed that is native to Adafruit IO. I am having trouble with one of the API endpoints from the documentation "data/last"

Here's my public feed: https://io.adafruit.com/api/v2/cheerlig ... /data/last

Without the last endpoint, the feed returns. Does anyone know what might be wrong? Only supports numerical last?

Thanks for the help.

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

Re: Getting the last data feed

Post by jwcooper »

The 'last' call is a write mode method that will read the last read value of the feed (it works in conjunction with 'first', 'next', 'previous'). That's the reason it won't work on a public feed. Only read-only methods work on public feeds.

I'd like to change that to work with public feeds (particularly 'last'), but in the meantime, you could use the 'retain', if csv is ok:
https://io.adafruit.com/api/v2/cheerlig ... ata/retain

User avatar
cheerlights
 
Posts: 2
Joined: Tue Nov 09, 2021 4:11 pm

Re: Getting the last data feed

Post by cheerlights »

Thanks. That is suitable for now. I +1 the idea to have those data endpoints map to public feeds.

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”