Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
MethodDescriptionExample
getByStationreturns scalar data by given location code and device category codemethod=getByStation


Anchor
getByCodes
getByCodes
getByStation

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

ParameterTypeDescriptionExample
Required
tokenstringcredential token. 
stationstringthe code of a station (For a list of stations see stations)NCBC
deviceCategorystringthe code of a device category (For a list of device categories for stations see  stations)BPR
Optional
sensorsstringa 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. 
dateFromdateinclusive start date in "yyyy-MM-ddTHH:mm:ss.SSSZ" format. If missing, the system will return last reading.2015-05-25T00:00:00.000Z
dateTodateexclusive 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
metadataString (case insensitive)

Minimum default
Provides only basic property information

Full 
Provides all property information

Minimum
outputFormatString (case insensitive)

Object – default

Data will be output as a list of objects for a given sensor. Inside each data object, there are sampleTime, value, and qaqcFlag

Array 
Data will be out put as three arrays for a given sensor. Array of sampleTime, array of values, array of qaqcFlags

Object
rowLimitintegerMaximum number of rows of scalar data returned for each sensor code. Default is 100,000. Maximum is 100,000.80000

 

Response

Success

Code Block
titleScalar Data Response
{
	"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]
	 			},
				...
			]
		},
		...
	]
}
PropertyTypeDescriptionOptionNotes
serviceMetadatajson objectmeta data information of the web service request.metadata=minimum 
serviceMetadata.stationstringrequested station codemetadata=minimum 
serviceMetadata.deviceCategorystringrequested device category codemetadata=minimum 
serviceMetadata.sensorsstringCSV searchable sensor codesmetadata=minimum 
serviceMetadata.dateFromstringrequested date from in yyyy-MM-ddTHH:mm:ss.SSSZ formatmetadata=minimum 
serviceMetadata.dateTostringrequested date to in yyyy-MM-ddTHH:mm:ss.SSSZ formatmetadata=minimum 
serviceMetadata.metadatastringrequested metadata optionmetadata=minimum 
serviceMetadata.rowLimitintegerrequested row limit per sensor codemetadata=minimum 
serviceMetadata.outputFormatstringthe requested data output formatmetadata=minimum 
serviceMetadata.totalActualSamplesintegerhow many scalar data expected in total for all the sensorsmetadata=minimum 
serviceMetadata.nextDateFromstringthe date from for next reading in yyyy-MM-ddTHH:mm:ss.SSSZ formatmetadata=minimum 
metadatajson objectmetadata station and device informationmetadata=full 
metadata.stationNamestringstation name for the given station codemetadata=full 
metadata.deviceCategoryNamestringdevice category name for the given category codemetadata=full 
metadata.dateFromstringthe date from for a given deployment in yyyy-MM-ddTHH:mm:ss.SSSZ formatmetadata=full 
metadata.dateTostringthe date to for a given deployment in yyyy-MM-ddTHH:mm:ss.SSSZ formatmetadata=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.bboxjson objectthe boundary of the station boxmetadata=full 
metadata.bbox.minLondoublethe minimum longitude of the station.metadata=full 
metadata.bbox.maxLondoublethe maximum longitude of the station.metadata=full 
metadata.bbox.minLatdoublethe minimum latitude of the station.metadata=full 
metadata.bbox.maxLatdoublethe maximum latitude of the station.metadata=full 
metadata.bbox.minDepthdoublethe minimum depth of the station.metadata=full 
metadata.bbox.maxDepthdoublethe maximum depth of the station.metadata=full 
sensordataarrayall available scalar data for given time rage within the row limitmetadata=minimum 
sensordata.sensorstringthe given sensor (the sensor's "code name" that can be used in queries)metadata=minimum 
sensordata.sensorNamestringthe full name for a given sensormetadata=minimum 
sensordata.unitOfMeasurestringunit of measure name for the scalar readingmetadata=minimum 
sensordata.actualSamplesintegerhow many samples expectedmetadata=minimum 
sensordata.dataarraysensor data for a given sensoroutputFormat=object 
sensordata.data.sampleTimestringtime stamp of the reading in yyyy-MM-ddTHH:mm:ss.SSSZ formatoutputFormat=object 
sensordata.data.valuedoulbescalar reading after calibration, derivation and unit conversionoutputFormat=object 
sensordata.data.qaqcFlagintegerqaqc flagoutputFormat=object 
sensordata.datajson objectsensor data for a given sensoroutputFormat=array 
sensordata.data.sampleTimesarrayan array of time stamp of the reading in yyyy-MM-ddTHH:mm:ss.SSSZ formatoutputFormat=array 
sensordata.data.valuesarrayan array of scalar reading after calibration, derivation and unit conversionoutputFormat=array 
sensordata.data.qaqcFlagsarrayan array of qaqc flagoutputFormat=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
titleJson response
{
	"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
titleJson response
{
	"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
	}
}