You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

Description

See the External Web Services for method, token, and responseType usage and error messages.

Gets the most recent raw data from an instrument, or raw data between two given dates.
If no time is specified, the data will be limited to the last hour of data.
If time is specified, the data is limited to 100,000 rows.

URL

http://dmas.uvic.ca/api/rawdata

Method

Description

Example

getByStation

Retrieve raw data available at given station.

method=getByStation

getByStation

Retrieve raw data available at given station. Data can be most
recent from instruments, or data that's been archived in a raw data file.

Parameters

Parameter

Type

Description

Example

Required

token

String

User Token

token=1234567890adbcde123

station

string

station code (corresponds with a search tree node, the one used in Data Search page)

station=IONA

deviceCategory

string

used to select which category of instruments at the station to use.
Corresponds with the name column in the device category table.

deviceCategory=DEVICECATEGORY
e.g., deviceCategory=AISRECEIVER

Optional

dateFrom

string

ISO8601 (extended) Date for the start time of the data. If not given,
defaults to one hour before current time, so that last hour of data is
returned (if there is data in the last hour), up to rowLimit number of
rows.

dateFrom=2015-01-02T00:12:42.000Z

dateTo

string

ISO8601 (extended) Date for end time of data. Defaults to the current time if not provided.
If no dateFrom is given and a dateTo is given, a date range error will be returned.
The max amount of data returned will be rowLimit.

dateTo=2015-12-31T23:59:59.000Z

rowLimit

integer

The maximum number of data to return, within the constraints of the
service. Note this will limit the data starting at the start time and
ending at the row limit, not necessarily at the end time. Default row limit: 100000
Treat negative or 0 rowLimit as max rowLimit. Treat rowLimit > maxRowLimit as max row limit

rowLimit=5000

Response

Success

 {   "data" : {
                "rawData": {string},
                "sampleTime": {string}
              },
                ...
    "metadata": {
        "queryMetadata": {
            "stationCode" : {string}, 
            "dateFrom"            : {string},
            "dateTo"          : {string},
            "deviceCategory"  : {string},
            "rowLimit"            : {integer}
        }
        "dataMetadata": {
            "numberOfData"    : {integer},
            "firstTimestamp"  : {string},
            "lastTimestamp"       : {string},
            "stationName"     : {string},
            "hasMoreDataInRange": {boolean}
        }
    }
}

Property

Type

Description

Example

data

string

The string containing the requested data, including the sample time and the raw data for each reading time

 

sampleTime

integer

The sample time for a single reading time. ISO8601 Extended Format.

2015-09-01T00:21:21.000Z

rawData

string

The string of raw data for the sampleTime

\c:1441212680,C:776,s: P-Cumshewa*1E!AIVDO,1,1,9,A,4030p;1uvA@kDnSi;fNJgk7008<8,0*47"

metadata

string

The metadata for the query and data

 

queryMetadata

string

The metadata for the query itself

 

  • stationCode

string

Query metadata: The station code (search tree node code) that was queried.

 

  • deviceCategory

string

Query metadata: the device category requested.

 

  • dateFrom

string

Query metadata: string date used in the query for the start time of the data

 

  • dateTo

string

Query metadata: string date used in the query for the end time of the data

  • rowLimit

integer

Query metadata: the value given, if any, in the query limiting the size of the data

 

dataMetadata

string

The metadata for the data itself

 

  • numberOfData

integer

Data metadata: the number of rows of data returned in the query.

 

  • firstTimeStamp

string

Data metadata: string ISO8601 representing the first timestamp returned.

 

  

  • lastTimeStamp

string

Data metadata: string ISO8601 representing the last timestamp returned.

 

  • stationName

string

Data metadata: name of the station (device)

 

  • hasMoreDataInRange

boolean

Data metadata: indicates whether all the data was returned with the query or whether more data is available in the requested range.

 

Example

Get most recent hour of raw data from an AIS receiver at Iona Shore Station: http://dmas.uvic.ca/api/rawdata?method=getByStation&deviceCategory=AISRECEIVER&station=IONA&token=SAMPLETOKEN123456789
Get data from AIS receiver at Iona Shore Station starting from September 1, 2015, at 21 minutes and 21 seconds after midnight:
http://dmas.uvic.ca/api/rawdata?token=12343123123123&method=getByStation&station=IONA&deviceCategory=AISRECEIVER&dateFrom=2015-09-01T00:21:21.000Z

{"data":
     [
      {
       "rawData":"\\c:1441061153,C:1990,s:P-Parke*58\\!AIVDM,2,1,8,B,55NP0eP26m;5L@O?CC0Lu8@tr0`Dq<Dr2222220N9@J885Kd0?4i@E531H88,0*79",
       "sampleTime":"2015-09-01T00:21:21.123Z"
       },
      {
        "rawData":"\\c:1441061153,C:1990,s:P-Parke*58\\!AIVDM,2,2,8,B,88888888880,2*2F",
        "sampleTime":"2015-09-01T00:21:21.250Z"
       },
       { 
          "rawData":"\\c:1441061153,C:1992,s:P-Helmcken*38\\!AIVDM,1,1,,B,15N;600P1Do>6CjKe>iG8Owb26jl,0*57",
          "sampleTime":"2015-09-01T00:21:21.352Z"},
       ...
     }],
    "metadata":
          {"dataMetadata": {
                  "firstTimestamp":"2015-09-01T00:21:21.123Z",
                  "hasMoreDataInRange":false,
                  "lastTimestamp":"2015-09-01T01:02:08.013Z",
                  "numberOfData":100000,
                  "stationName":"Iona Shore Station"
                 },
          "queryMetadata":{
                 "deviceCategory":"AISRECEIVER",
                 "dateTo":null,
                 "rowLimit":null,
                 "dateFrom":"2015-09-01T00:21:21.000Z",
                 "stationCode":"IONA"
          }
     }
}
  • No labels