1.Overview
ObtainPower supply status(available under networking)。
2.Request method
3.Parameter Description
Attribute |
Type |
Constraint |
Explanation |
accountSid |
String |
Required |
Account ID.(The accountSid and authToken are assigned by QR Master admin when applying for a developer account)
|
timestamp |
String |
Required |
Request timestamp |
type |
String |
Required |
请求Type(1Room;2Floor;3Building;4Community) |
communityNo |
String |
Required |
Community No. |
buildNo |
String |
Optional |
Building No. (当CheckBuilding、Floor、Room时,此Required parameters必填。) |
floorNo |
String |
Optional |
Floor No. (当CheckFloor、Room时,此Required parameters必填。) |
roomNo |
String |
Optional |
Room No. (当CheckRoom时,此Required parameters必填。) |
4.Request address
5.Generate signature for parameter
Ⅰ.Add the authToken parameter to the POST key-value pair to get the original signature data. (The accountSid and authToken are assigned by QR Master admin when applying for a developer account)
Ⅱ.Sort the original signature data in lexicographical order of parameter names.
Ⅲ.Joining together into a string like "key1=value1&key2=value2...". The key/value shall be encoded in x-www-form-urlencode.
Ⅳ.Calculate the sha1 value of the string to get the sig.
Note: this authToken should not be submitted to the network with the POST parameter.
6.Request samples(Raw)
POST http://api.uclbrt.com/Home/Records/getElecstate?sig=d56ade1486d925717dc946181f6147c815494f21 HTTP/1.1
Host: api.uclbrt.com
Connection: Keep-Alive
Accept: application/json
Content-Length: 205
Content-Type: application/x-www-form-urlencoded
accountSid=98651082ab89c3f1b50f35caf794179f×tamp=1590379366&type=1&communityNo=1316879946&buildNo=001&floorNo=001&roomNo=R007
7.Return
Parameter Description
Attribute |
Explanation |
buildNo |
Building No. |
floorNo |
Floor No. |
roomNo |
Room No. |
elecstate |
Power access status, 255- unknown; 1- Power fetching; 0- Power off |
Succeeded:
{"status":200,"info":"success","data":[ { "buildNo": "001", "floorNo": "000", "roomNo": "1000", "elecstate": "1" }]}
Failed:
{"status":6209,"info":"Room information query failed"}
8.SDK