This request returns a JSON object with the current state of all configured inputs and outputs. It can be polled or just called once before opening the server events stream in order to get a starting state as the stream only sends changes.
all json keys are lower case.
Request: http://xtgpio.local/api/data
example output:
{ "name": "DEV GPIO", "format": "F", "rssi": -39, "cputemp": 123, "gpio": [ { "index": 1, "name": "GPIO #1", "type": 3, "dimmable": false, "state": true }, { "index": 2, "name": "GPIO #2", "type": 3, "dimmable": false, "state": true }, { "index": 3, "name": "GPIO #3", "type": 3, "dimmable": false, "state": true }, { "index": 4, "name": "GPIO #4", "type": 3, "dimmable": false, "state": true }, { “index”:5, “name”:”TEMP/HUM Sensor”, “type”:21, “temp”:76.4, “hum”:43 } ], "onewire": [ { "id": "FFA181", "value": 35.9375, "reliability": 100 } ] }
The type codes used in the above data to show what the GPIO is configured as: