/v1/method/
- Makes a single request but encode all request in an URL. This request supports only simple parameter types and doesn’t support nesting in the parameters. If you need to make more complex queries then use /v1/request.
- id of a request will be generated by HTTPS server for each request
- name of command should be part of the link after the 3rd component, all ‘.’ chars should be replaced with ‘/’.
- parameters of a request should be passed as HTTP URL query string with specific conversion rules
Edit
Parameters conversions rules
Edit
- parameter=value
{
"params": {
"<parameter>":"<value>"
}
}
Edit
- parameter_bool=booleanValue
{
"params": {
"<parameter>":<booleanValue>
}
}
Edit
- parameter_int=integerValue
{
"params": {
"<parameter>":<integerValue>
}
}
Edit
- parameter_float=floatValue
{
"params": {
"<parameter>":<floatValue>
}
}
Edit
Type:
Key | Value | Description |
---|---|---|
Authorization | Basic + base64 id of user id and access token | A user id and access token in the basic scheme according to standard of Basic HTTP authorization. This header is more priority as user and token pair. |
login | Id of a user | UUID of a user( the same as user in a hub.offline.login.ui request ) |
token | Access token | Access token from cloud( the same as token in a hub.offline.login.ui request ) |
Edit
Data:
https://<ip>:17000/v1/method/hub/info/get
https://<ip>:17000/v1/method/hub/item/value/set?_id=09234njnj234&value=cooling
https://<ip>:17000/v1/method/hub/item/value/set?_id=09234njnj234&value_bool=false
https://<ip>:17000/v1/method/hub/item/value/set?_id=1234567890&value_int=22
https://<ip>:17000/v1/method/hub/item/value/set?_id=1234567890&value_float=123.456
Edit
HTTP Status Code | Case Description |
---|---|
400 | If a request doesn’t have data or it’s not valid JSON format |
401 | If user or token header missed or it has incorrect values |
408 | If a request runs more then 1 minute |
429 | If a controller has more then 100 “opened” requests now |
500 | Any WebSocket formatted error on request |