Skip to content

Devices API

Martin Konopka edited this page Apr 23, 2018 · 2 revisions

Get states of all devices

GET /api/device/

Returns states for all devices with timestamps of last change.

Request

  • Parameters: None.
  • Body: None.

Response

  • DeviceStateChange[], each object contains:
    • device : string - device code type, e.g., ET for eye tracker.
    • state : DeviceState string - one of the following values: Disconnected, Connected, Recording, Error.
    • lastChange : DateTime string - last change of the status.

Examples

$ curl -X GET http://localhost:55555/api/device

[{"device":"ET","state":"Connected","lastChange":"2018-03-08T14:27:29.9616392"},{"device":"EXTEV","state":"Connected","lastChange":"2018-03-08T14:27:28.4030785"},{"device":"KB","state":"Connected","lastChange":"2018-03-08T14:27:28.4367896"},{"device":"ME","state":"Connected","lastChange":"2018-03-08T14:27:28.4367896"},{"device":"SC","state":"Connected","lastChange":"2018-03-08T14:27:29.9616392"},{"device":"WCA","state":"Connected","lastChange":"2018-03-08T14:27:29.1518847"},{"device":"WCV","state":"Connected","lastChange":"2018-03-08T14:27:29.7073150"}]

Get state of a single device

GET /api/device/{deviceCode}

Returns state of the selected device, specified with the parameter deviceCode in the URI.

Request

  • Parameters:
    • deviceCode : string (URI) - code of the device which to return status for, e.g., ET for eye tracker. See Devices and Recording Data for list of device type codes.

Response

  • 200 HTTP Status code with DeviceStateChange object (see above) for the selected device, if exists; otherwise,
  • 404 Not found, if no device with such code exist.

Examples

$ curl -X GET http://localhost:55555/api/device/ET

{"device":"ET","state":"Connected","lastChange":"2018-03-08T14:27:29.9616392"}
Clone this wiki locally