需要不使用Firebase API的Nest REST API的工作示例 [英] Need Working Example of Nest REST API without using Firebase API
问题描述
我正在努力寻找一个使用简单的数据将数据写入Nest Thermostat API的可行示例.尝试编写C#应用程序且无法使用Firebase.到目前为止发布的多个Curl示例不起作用.我有一个有效的auth_token,可以毫无问题地读取数据.寻找正确的发布网址是难以捉摸的.有人可以协助吗?
I'm struggling trying to find a working example of writing data to the Nest Thermostat API using plain rest. Attempting to write a C# app and cannot use Firebase. The multiple Curl examples posted so far do not work. I have a valid auth_token and can read data without issues. Finding the correct post url is elusive. Can anyone assist?
curl -v -X PUT "https://developer-api.nest.com/structures/g-9y-2xkHpBh1MGkVaqXOGJiKOB9MkoW1hhYyQk2vAunCK8a731jbg?auth=<AUTH_TOKEN>" -H "Content-Type: application/json" -d '{"away":"away"}'
请勿更改任何数据.
推荐答案
两件事.首先,使用-L进行重定向.其次,直接放置到遥远的数据位置,例如
Two things. First, follow redirects with -L. Second, put directly to the away data location, like
curl -v -L -X PUT "https://developer-api.nest.com/structures/g-9y-2xkHpBh1MGkVaqXOGJiKOB9MkoW1hhYyQk2vAunCK8a731jbg/away?auth=<AUTH_TOKEN>" -H "Content-Type: application/json" -d '"away"'
PUT将覆盖某个位置的所有数据.上一条命令在逻辑上将结构的数据设置为{"away":"away"}
.
The PUT overwrites all data at a location. The previous command would logically be setting the structure's data to just {"away":"away"}
.
这篇关于需要不使用Firebase API的Nest REST API的工作示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!