4.1.1 Requests

The client-server communication is used. The client sends a data/command execution request and the server sends a response. The request consists of URL and optional data in the following format:

https://<IP>/api/v1/<subsystem>?<parameters>
  • IP is the IDT IP address
  • <subsystem> designates the system part to be controlled
  • <parameters> includes request details

For example:

https://192.168.254.228/api/v1/gpio?action=set&name=io2&type=direction&value=out

means that the client wants to switch the GPIO pin to output in the GPIO subsystem.

If the data to be transferred are rather extensive, store the data in the JSON format in the HTTP request body (Content-Type: application/json; charset=UTF-8). 
Refer to the list of command parameters for these exceptions.

The HTTP method GET is used for the requests that do not transmit data. The PUT method is used for the requests that include data.