Domotys WTS
  • Installation
  • Vues
  • Application
  • Fiche Technique
  • Installation
  • Nœud Réception
  • Nœud Envoi
  • Protocols
  • Variables
  • Requests
  • Events
  • English
  • Français
  • Installation
  • Vues
  • Application
  • Fiche Technique
  • Installation
  • Nœud Réception
  • Nœud Envoi
  • Protocols
  • Variables
  • Requests
  • Events
  • English
  • Français
  • Protocols
  • Variables
    • Domains
      • action
      • alarm
      • buzzer
      • config
      • date_time
      • domotys
      • heat
      • home
      • home_action
      • information
      • lighting
      • message
      • network
      • opening
      • screen
      • sd
      • theme
      • update
      • view_list
    • Type Definitions
    • ID Definitions
  • Requests
    • Get JSON
    • Set JSON
    • Set States
    • Set States View List
    • Get Files
    • Get Files List
    • Get Screenshot
    • Diverse
  • Events

Requests

The requests are available in both protocols (HTTP & JSON TCP).

HTTP

The requests operate according to the definitions of the HTTP protocol and accept the GET and POST methods. Parameters are to be passed in the data of these methods.

The requests return a JSON file (except for Get Files requests). If the request has no error, the JSON file will contain a variable code with the value 200. If an error is detected, the code variable will have the value 400. An array named message will also be returned, containing error messages.

Error response exemple :
{
	"code":400,
    "message":[
        "The received JSON cannot be parsed"
    ]
}

JSON TCP

The JSON TCP protocol also accepts requests. For this, a JSON must be sent with an object variable named request containing the following variables:

url

Endpoint of the request.

  • Type: string

data

Request parameters.

  • Type: Arrayofjson-tcp-parameter-array
  • Note: The JSON data must be stringified
Request exemple :
{
	"request": {
        "url":"/api/set/json",
        "data":[
            ["json":"{...}"]
        ]
    },
    "id":"message-id", //Optional
    "password":"password" //If defined and only for the first request
}
Response exemple :
{
	"request":{
        "response": {
            "code":200
        },
        "content_type":"application/json"
    },
    "id":"message-id" //Returns the received ID if defined.
}
Error Response :

In case of an error, the server returns an object named error :

{
	"error":{
        "code": 401,
        "desc":"Unauthorized"
    },
    "id":"message-id" //Returns the received ID if defined.
}
  • code: Error code similar to HTTP error codes
  • desc: Description of the error
Prev
Variables
Next
Events