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

Compare with Current View Page History

« Previous Version 7 Next »

Description

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

API scalardata gets scalar data.

URL

http://dmas.uvic.ca/api/scalardata
MethodDescriptionExample
getByStationreturns scalar data by given location code and device category codemethod=getByStation


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 stationNCBC
deviceCategorystringthe code of a device categoryBPR
Optional
sensorsstringa comma separated list of sensor code. 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

Minimum (default or if missing) (case insensitive)
provides only basic property information

Full  (case insensitive)
provides all property information

Minimum
outputFormatString

Object (default or if missing)  (case insensitive)

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

Array  (case insensitive)
data will be out put as three arrays for a given sensor. Array of sampleTime, array of values, array of qaqcFlags

Object
rowLimitintegermaximum row scalar data returns for each sensor code. For those data they are sorted by sample time. If missing or invalid number, the maximum 100,000 will be used. If given number is over 100,000, the maximum 100,000 will be used.80,000

 

Response

Success

Sample <responseType> 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.sensorstringsensor code for a given sensormetadata=minimum 
sensordata.sensorNamestringsensor 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

 

{
	"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
	}
}

 

 

  • No labels