查看Cloud Of Things API的源代码
←
Cloud Of Things API
跳转到:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
== Devices == === 创建设备 === <br> {| border="0" width=500 cellspacing="1" cellpadding="8" align="left" bgcolor=#1b74c2 | style="background:#dee7ec" width=80| URL | style="background:#ffffff" | http://api.easyhomelink.org/v1/devices |- | style="background:#dee7ec" | Formats | style="background:#ffffff" | JSON |- | style="background:#dee7ec" | Methods | style="background:#ffffff" | POST |- | style="background:#dee7ec" | Returns | style="background:#ffffff" | 设备 ID |} 例子: data.txt: <pre> POST /v1/devices HTTP/1.1 Accept: */* x-key: YOUR_X-KEY Content-Length: 177 Content-Type: text/html { "name":"Home Enviroment", "description":"Home", "tags":["temperature","Home"], "location":{ "local":"Nanjing", "latitude":24.123, "longitude":34.456 } } </pre> <pre> cat data.txt | netcat api.easyhomelink.org 80 </pre> 返回数据 (JSON): <pre> { "DEV_ID": 2 } </pre> <br><br> === 查看设备 === <br> {| border="0" width=500 cellspacing="1" cellpadding="8" align="left" bgcolor=#1b74c2 | style="background:#dee7ec" width=80| URL | style="background:#ffffff" | http://api.easyhomelink.org/v1/device/DEV_ID |- | style="background:#dee7ec" | Formats | style="background:#ffffff" | JSON |- | style="background:#dee7ec" | Methods | style="background:#ffffff" | GET |- | style="background:#dee7ec" | Returns | style="background:#ffffff" | 设备信息 |} 例子: <pre> curl --request GET --header "UID: YOUR_UUID" http://api.easyhomelink.org/v1/device/DEV_ID </pre> 返回 JSON 格式数据: <pre> { "name":"Home Enviroment", "description":"Home", "tags":["temperature","Home"], "location":{ "local":"Nanjing", "latitude":24.123, "longitude":34.456 } } </pre> <br><br> === 编辑设备 === <br> {| border="0" width=500 cellspacing="1" cellpadding="8" align="left" bgcolor=#1b74c2 | style="background:#dee7ec" width=80| URL | style="background:#ffffff" | http://api.easyhomelink.org/v1/device/DEV_ID |- | style="background:#dee7ec" | Formats | style="background:#ffffff" | JSON |- | style="background:#dee7ec" | Methods | style="background:#ffffff" | PUT |- | style="background:#dee7ec" | Returns | style="background:#ffffff" | 无 |} 例子: <pre> curl --request PUT --data-binary @data.txt --header "UID: YOUR_UUID" http://api.easyhomelink.org/v1/device/DEV_ID </pre> data.txt (JSON): <pre> { "name":"Home Enviroment", "description":"Home", "tags":["temperature","Home"], "location":{ "local":"Nanjing", "latitude":32.071852, "longitude":118.793551, } } </pre> <br><br> === 删除设备 === <br> {| border="0" width=500 cellspacing="1" cellpadding="8" align="left" bgcolor=#1b74c2 | style="background:#dee7ec" width=80| URL | style="background:#ffffff" | http://api.easyhomelink.org/v1/device/DEV_ID |- | style="background:#dee7ec" | Formats | style="background:#ffffff" | JSON |- | style="background:#dee7ec" | Methods | style="background:#ffffff" | DELETE |- | style="background:#dee7ec" | Returns | style="background:#ffffff" | 无 |} 例子: <pre> curl --request DELETE --data-binary @data.txt --header "UID: YOUR_UUID" http://api.easyhomelink.org/v1/device/DEV_ID </pre> <br><br> === 罗列设备 === 罗列 UID 用户的所有设备 <br> {| border="0" width=500 cellspacing="1" cellpadding="8" align="left" bgcolor=#1b74c2 | style="background:#dee7ec" width=80| URL | style="background:#ffffff" | http://api.easyhomelink.org/v1/devices |- | style="background:#dee7ec" | Formats | style="background:#ffffff" | JSON |- | style="background:#dee7ec" | Methods | style="background:#ffffff" | PUT |- | style="background:#dee7ec" | Returns | style="background:#ffffff" | 当前用户的所有设备概要描述 |} 例子: <pre> curl --request GET --header "UID: YOUR_UUID" http://api.easyhomelink.org/v1/devices </pre> 返回 JSON 格式数据: <pre> [ { "id": 1, "name": "Home", "about": "Home enviroment" }, { "id": 2, "name": "Outdoor", "about": "Outdoor enviroment" } ] </pre> <br><br>
返回到
Cloud Of Things API
。
个人工具
3.136.84.88
该IP地址的讨论
登录
名字空间
页面
讨论
变换
查看
阅读
查看源代码
查看历史
操作
搜索
导航
首页
社区专页
新闻动态
最近更改
随机页面
帮助
工具箱
链入页面
相关更改
特殊页面