Description
See the External Web Services for method, token, and responseType usage and error messages.
API scalardata gets scalar data.
URL
No Format |
---|
http://dmas.uvic.ca/api/scalardata |
Method | Description | Example |
---|---|---|
getByStation | returns scalar data by given location code and device category code | method=getByStation |
Anchor | ||||
---|---|---|---|---|
|
Returns scalar data in json format by given location code and device category code. If you want to discover stations and deviceCategories you can use with the scalar data service, see the stations service documentation.
Parameters
Parameter | Type | Description | Example |
---|---|---|---|
Required | |||
token | string | credential token. | |
station | string | the code of a station (For a list of stations see stations) | NCBC |
deviceCategory | string | the code of a device category (For a list of device categories for stations see stations) | BPR |
Optional | |||
sensors | string | a comma separated list of sensor codes for a station and device category. If missing, the system will return all search scalar data within to station code and device category code pair. | |
dateFrom | date | inclusive start date in "yyyy-MM-ddTHH:mm:ss.SSSZ" format. If missing, the system will return last reading. | 2015-05-25T00:00:00.000Z |
dateTo | date | exclusive end date in "yyyy-MM-ddTHH:mm:ss.SSSZ" format. If missing the system will use 1 day range. | 2015-05-26T00:00:00.000Z |
metadata | String (case insensitive) | Minimum – default Full | Minimum |
outputFormat | String (case insensitive) | Object – default Array | Object |
rowLimit | integer | Maximum number of rows of scalar data returned for each sensor code. Default is 100,000. Maximum is 100,000. | 80000 |
Response
Success
Code Block | ||
---|---|---|
| ||
{ "serviceMetadata": { "station": string, "deviceCategory": string, "sensors": string, "dateFrom": string, "dateTo": string, "metadata": string, "rowLimit": string, "outputFormat": stirng, "totalActualSamples": integer, "nextDateFrom": string }, "metadata": { "stationName": string, "deviceCategoryName": string, "dateFrom": string, "dateTo": string, "longitude": double, "latitude": double, "depth": double, "bbox": { "minLon": double, "maxLon": double, "minLat": double, "maxLat": double, "minDepth": double, "maxDepth": double } }, "sensorData": [ { "sensor": string, "sensorName": string, "unitOfMeasure": string, "actualSamples"" integer, "data": [//outputFormat=object { "sampleTime": string, "value": double, "qaqcFlag": integer }, ... "data": [//outputFormat=array { "sampleTimes": [array of strings], "values": [array of doubles], "qaqcFlags": [array of integers] }, ... ] }, ... ] } |
Property | Type | Description | Option | Notes |
---|---|---|---|---|
serviceMetadata | json object | meta data information of the web service request. | metadata=minimum | |
serviceMetadata.station | string | requested station code | metadata=minimum | |
serviceMetadata.deviceCategory | string | requested device category code | metadata=minimum | |
serviceMetadata.sensors | string | CSV searchable sensor codes | metadata=minimum | |
serviceMetadata.dateFrom | string | requested date from in yyyy-MM-ddTHH:mm:ss.SSSZ format | metadata=minimum | |
serviceMetadata.dateTo | string | requested date to in yyyy-MM-ddTHH:mm:ss.SSSZ format | metadata=minimum | |
serviceMetadata.metadata | string | requested metadata option | metadata=minimum | |
serviceMetadata.rowLimit | integer | requested row limit per sensor code | metadata=minimum | |
serviceMetadata.outputFormat | string | the requested data output format | metadata=minimum | |
serviceMetadata.totalActualSamples | integer | how many scalar data expected in total for all the sensors | metadata=minimum | |
serviceMetadata.nextDateFrom | string | the date from for next reading in yyyy-MM-ddTHH:mm:ss.SSSZ format | metadata=minimum | |
metadata | json object | metadata station and device information | metadata=full | |
metadata.stationName | string | station name for the given station code | metadata=full | |
metadata.deviceCategoryName | string | device category name for the given category code | metadata=full | |
metadata.dateFrom | string | the date from for a given deployment in yyyy-MM-ddTHH:mm:ss.SSSZ format | metadata=full | |
metadata.dateTo | string | the date to for a given deployment in yyyy-MM-ddTHH:mm:ss.SSSZ format | metadata=full | |
metadata.longitude | double | the aggregate (mean) longitude of the station. | metadata=full | |
metadata.latitude | double | the aggregate (mean) latitude of the station. | metadata=full | |
metadata.depth | double | the aggregate (mean) depth of the station. | metadata=full | |
metadata.bbox | json object | the boundary of the station box | metadata=full | |
metadata.bbox.minLon | double | the minimum longitude of the station. | metadata=full | |
metadata.bbox.maxLon | double | the maximum longitude of the station. | metadata=full | |
metadata.bbox.minLat | double | the minimum latitude of the station. | metadata=full | |
metadata.bbox.maxLat | double | the maximum latitude of the station. | metadata=full | |
metadata.bbox.minDepth | double | the minimum depth of the station. | metadata=full | |
metadata.bbox.maxDepth | double | the maximum depth of the station. | metadata=full | |
sensordata | array | all available scalar data for given time rage within the row limit | metadata=minimum | |
sensordata.sensor | string | the given sensor (the sensor's "code name" that can be used in queries) | metadata=minimum | |
sensordata.sensorName | string | the full name for a given sensor | metadata=minimum | |
sensordata.unitOfMeasure | string | unit of measure name for the scalar reading | metadata=minimum | |
sensordata.actualSamples | integer | how many samples expected | metadata=minimum | |
sensordata.data | array | sensor data for a given sensor | outputFormat=object | |
sensordata.data.sampleTime | string | time stamp of the reading in yyyy-MM-ddTHH:mm:ss.SSSZ format | outputFormat=object | |
sensordata.data.value | doulbe | scalar reading after calibration, derivation and unit conversion | outputFormat=object | |
sensordata.data.qaqcFlag | integer | qaqc flag | outputFormat=object | |
sensordata.data | json object | sensor data for a given sensor | outputFormat=array | |
sensordata.data.sampleTimes | array | an array of time stamp of the reading in yyyy-MM-ddTHH:mm:ss.SSSZ format | outputFormat=array | |
sensordata.data.values | array | an array of scalar reading after calibration, derivation and unit conversion | outputFormat=array | |
sensordata.data.qaqcFlags | array | an array of qaqc flag | outputFormat=array |
Note: if the value is null. The json be presented with null for the value.
Example:
http://dmas.uvic.ca/api/scalardata?method=getByStation&token=<yourValidToken>&station=SCHDW.O1&deviceCategory=OXYSENSOR
Code Block | ||
---|---|---|
| ||
{ "sensorData": [{ "actualSamples": 1, "data": [{ "qaqcFlag": 0, "sampleTime": "2015-08-20T17:30:53.058Z", "value": 23.4859 }], "sensor": "Temperature", "sensorName": "Temperature", "unitOfMeasure": "C" }, { "actualSamples": 1, "data": [{ "qaqcFlag": 1, "sampleTime": "2015-08-20T17:30:53.058Z", "value": 4.417862252 }], "sensor": "oxygen", "sensorName": "Oxygen", "unitOfMeasure": "ml/l" }], "serviceMetadata": { "dateFrom": null, "dateTo": null, "deviceCategory": "OXYSENSOR", "nextDateFrom": null, "outputFormat": null, "rowLimit": null, "sensors": null, "station": "SCHDW.O1", "totalActualSamples": 2 } } |
Example using sensor code:
http://dmas.uvic.ca/api/scalardata?method=getByStation&token=a3079716-7d07-4d4a-bb5d-e521ad60b784&station=SCHDW.O1&deviceCategory=OXYSENSOR&sensors=oxygen
Code Block | ||
---|---|---|
| ||
{ "sensorData": [{ "actualSamples": 1, "data": [{ "qaqcFlag": 1, "sampleTime": "2015-12-08T18:52:35.089Z", "value": 2.42722139 }], "sensor": "oxygen", "sensorName": "Oxygen", "unitOfMeasure": "ml/l" }], "serviceMetadata": { "dateFrom": null, "dateTo": null, "deviceCategory": "OXYSENSOR", "nextDateFrom": null, "outputFormat": null, "rowLimit": null, "sensors": "oxygen", "station": "SCHDW.O1", "totalActualSamples": 1 } } |