REST API - Fetching Device Fields

Fetching Device Fields

The URL for this endpoint is: https://www.satvue.com.au/api/listDeviceFields.

The listDeviceFields endpoint will return all the fields on a single device. It requires the following parameters to be passed in via either HTTP GET or POST parameters. All parameters must be URL encoded.

  • access_id: The Access ID of the API Key.
  • secret: The Secret of the API Key.
  • serial: The Serial Number of the device to get fields from.

The available devices for the API Key will be returned in the following JSON structure:

{
   "success": [true|false],
   "error": "[Error String if success=false]",
   "fields": [
      [
         "name":"[The name of the field]",
         "units":"[The units of the field]",
         "alarm_active":[true if this field is in the alarm state, false otherwise],
         "last_timestamp":"[Timestamp of the most recent value on this field]",
         "last_value":"[Value of the most recent value on this field]"
      ],
      ...
   ]
}
					

The following is an cURL example of how to use this API Endpoint using a GET request.

curl "https://www.satvue.com.au/api/listDeviceFields?access_id=[ACCESS_ID]&secret=[SECRET]&serial=[SERIAL_NUMBER]"
					

The following is an cURL example of how to use this API Endpoint using a POST request.

curl --data "access_id=[ACCESS_ID]&secret=[SECRET]&serial=[SERIAL_NUMBER]" "https://www.satvue.com.au/api/listDeviceFields"
					

The following is example the data returned by this endpoint.

{
   "success":true,
   "serial":"01003692SKY3199",
   "data":[
      {
         "name":"Depth",
         "units":"m",
         "alarm_active":false,
         "last_timestamp":"2020-08-29 00:00:00+10",
         "last_value":"1.23"
      },
      {
         "name":"Temperature",
         "units":"°C",
         "alarm_active":false,
         "last_timestamp":"2020-08-29 00:00:00+10",
         "last_value":"24.2"
      }
   ]
}