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 |
---|---|---|
Retrieve raw data available at given station. |
method= |
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= |
station |
string |
station code (corresponds with a search tree node, the one used in Data Search page) |
station= |
deviceCategory |
string |
used to select which category of instruments at the station to use. |
deviceCategory= |
Optional |
|||
dateFrom |
string |
ISO8601 (extended) Date for the start time of the data. If not given, |
dateFrom= |
dateTo |
string |
ISO8601 (extended) Date for end time of data. Defaults to the current time if not provided. |
dateTo= |
rowLimit |
integer |
The maximum number of data to return, within the constraints of the |
rowLimit= |
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. |
|
|
rawData |
string |
The string of raw data for the sampleTime |
|
|
metadata |
string |
The metadata for the query and data |
|
|
queryMetadata |
string |
The metadata for the query itself |
|
|
|
string |
Query metadata: The station code (search tree node code) that was queried. |
|
|
|
string |
Query metadata: the device category requested. |
|
|
|
string |
Query metadata: string date used in the query for the start time of the data |
|
|
|
string |
Query metadata: string date used in the query for the end time of the data |
||
|
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 |
|
|
|
integer |
Data metadata: the number of rows of data returned in the query. |
|
|
|
string |
Data metadata: string ISO8601 representing the first timestamp returned. |
|
|
|
string |
Data metadata: string ISO8601 representing the last timestamp returned. |
|
|
|
string |
Data metadata: name of the station (device) |
|
|
|
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" } } }