Set JSON
Applies new values to one or more domains, only variables with the Write
attribute can be modified.
HTTP Request
- Methods :
GET/POST
- URL multi domain :
http://screen-address:8080/api/set/json
- URL single domain :
http://screen-address:8080/api/set/json/{domain}
JSON TCP Request
- URL multi domain :
/api/set/json
- URL single domain :
/api/set/json/{domain}
Parameters
Attribute | Description |
---|---|
json | json data stringified |
password | api password (optional) |
domain | if set to 1, the response will contain the modified domains |
no-save | if set to 1, the modified variables will not be saved in the screen memory |
HTTP single domain exemple
Request :
GET http://screen-address:8080/api/set/json/screen?json={"screen_state":1}
Response :
{ "code": 200 }
HTTP multi domain exemple
Request :
GET http://screen-address:8080/api/set/json?json={"screen":{"screen_state":1},"buzzer":{"set":0}}
Response :
{ "code": 200 }
JSON TCP single domain exemple
Request :
{
"request": {
"url":"/api/set/json/screen",
"data":[
["json","{\"screen_state\":1}"]
]
},
"id":"message-id", //Optional
"password":"password" //If defined and only for the first request
}
Response :
{
"request":{
"response": {
"code":200
},
"content_type":"application/json"
},
"id":"message-id" //Returns the received ID if defined.
}
JSON TCP multi domain exemple
Request :
{
"request": {
"url":"/api/set/json",
"data":[
["json","{\"screen\":{\"screen_state\":1},\"buzzer\":{\"set\":0}}"]
]
},
"id":"message-id", //Optional
"password":"password" //If defined and only for the first request
}
Response :
{
"request":{
"response": {
"code":200
},
"content_type":"application/json"
},
"id":"message-id" //Returns the received ID if defined.
}