26.01.2016, 07:35
First, you need to get auth token, after that it's pretty simple with HTTP requests.
Nest docs:
https://developer.nest.com/documentation...ick-guide/
Here's a short code sample:
Nest docs:
https://developer.nest.com/documentation...ick-guide/
Here's a short code sample:
Code:
function request()
local auth, url, res, stat, hdrs
require('json')
require('ssl.https')
auth = '...'
url = 'https://developer-api.nest.com/devices.json?auth=' .. auth
res, stat, hdrs = ssl.https.request(url)
if stat == 307 then
res = ssl.https.request(hdrs.location)
end
return json.decode(res)
end
res, data = pcall(request)
log(data)