Difference between revisions of "IoTGateway/RESTful APIv2 QuickGuide"
From ESS-WIKI
Chinchen.lin (talk | contribs) |
Chinchen.lin (talk | contribs) (→Linear Dust WSN Resources) |
||
Line 30: | Line 30: | ||
| Request JSON Data|| N/A | | Request JSON Data|| N/A | ||
|- | |- | ||
− | | Response JSON Data|| { | + | | Response JSON Data|| |
+ | { | ||
"result":{ | "result":{ | ||
"e":[ | "e":[ | ||
Line 50: | Line 51: | ||
] | ] | ||
} | } | ||
− | } | + | } |
|- | |- | ||
| Example || curl -H "Content-Type: application/json" -X GET http://username:password@<IP:Port>/restapi | | Example || curl -H "Content-Type: application/json" -X GET http://username:password@<IP:Port>/restapi |
Revision as of 09:41, 1 June 2016
RESTful API and MQTT Topics
URL Specification
Every URL relates to a specific resource or list of resources.
RESTful API: http://<ip address>:port/restapi/<resource path>
Default Port: 3000
Default User Name: admin
Default Password: admin
MQTT Topic: <resource path>
MQTT response is not include ‘{"result": }’
Linear Dust WSN Resources
Header text | Header text |
---|---|
Description | Retrieve the WSN manager setting information. |
URI Resource Path | /WSNMgmt/IoTGW/WSN/<mac addr>/Setting |
MQTT Topic Format | /WSNMgmt/IoTGW/WSN/<mac addr>/Setting |
Method(HTTP/MQTT) | GET/SUB |
Request JSON Data | N/A |
Response JSON Data |
{ "result":{ "e":[ { "n":"NetID", "sv":"2001", "asm":"rw" }, { "n":"JoinKey", "sv":"JOINADVANTECHIOT", "asm":"rw" }, { "n":"Interface", "v":1, "asm":"r" } ] } } |
Example | curl -H "Content-Type: application/json" -X GET http://username:password@<IP:Port>/restapi
/WSNMgmt/IoTGW/WSN/<mac addr>/Setting |
Example | mosquito_sub -h <IP> -C 1 -t /WSNMgmt/IoTGW/WSN/<mac addr>/Setting |