Here is an example how to poll data from your Gateway:
e.g.
curl -H “Authorization: Bearer 0i0XJhGjpiMdEBRxI+hEXtJoGoL1jM7DFv6c6netsjU=” http://192.168.1.108/history
after setting up the Bearer authentication.
If you want to get data from Ruuvi Cloud, you can use our API:
Please note that our API is in beta and while we use it internally and don’t plan to do any big changes, some breaking changes are to be expected especially before we have launched the Ultimate subscription plan.
From /verify you get the actually access token you can use to authenticate to Ruuvi Cloud. Please be careful while developing, we may throttle or ban IPs and accounts which cause exceptional amount of traffic for example by downloading full history data of a tag repeatedly as that resembles a DOS attack to our service.
Thanx!
I found the API alright, just not an automated flow for retrieving the token. Reading mail can of course be done by servers but it quite cumbersome compared to normal OAuth-processes.
What is the lifespan of the token returned from this?
I saw that this is the same flow that You use in your web-frontend.
Of course I will cache the data. In my simple use case I want to display the last few hours temperature in the Sauna to be able to determine if the sauna is on or off.