REST API - Fetching Data

Fetching Data

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

The getDeviceData 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.
  • start: A timestamp to start searching for data.
  • end: [Optional] A timestamp to stop searching for data.
  • field: [Optional] A single device field name, only return data for this field.

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

{
   "success": [true|false],
   "error": "[Error String if success=false]",
   "data": [
      [
         "timestamp":"[The timestamp of this data record]",
         "[Device Field 1 Name]":"[Device Field 1 Value]",
         "[Device Field 2 Name]":"[Device Field 2 Value]",
         ...
      ],
      ...
   ]
}
					

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

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

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]&start[START_TIMESTAMP]&field[FIELD_NAME]" "https://www.satvue.com.au/api/getDeviceData"
					

The following is example the data returned by this endpoint.

{
   "success":true,
   "serial":"01003692SKY3199",
   "data":[
      {
         "timestamp":"2020\/07\/28 13:55:03 +10:00",
         "Depth":"1.23",
         "Temperature":"24.2"
      },
      {
         "timestamp":"2020\/07\/28 14:39:33 +10:00",
         "Depth":"1.53",
         "Temperature":"24.9"
      }
}