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

Compare with Current View Page History

« Previous Version 11 Next »

Description

The API properties service returns all the properties defined in DMAS that meet a filter criteria.

Properties are observable phenomenon (aka, variables) and are the common names given to sensor types (ie, oxygen, pressure, temperature, etc)

The primary purpose of the properties service, is to find the available properties of the data you are interested in and use the propertyCode when requesting a data product using the dataProductDelivery web service.

For a list of available property codes, along with names, descriptions and units of measure, see the Available Properties page.


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

URL

http://data.oceannetworks.ca/api/properties

Method

Description

Example

get

Retrieve a list Property codes and descriptions

method=get

 get

The get method retrieves a list of property codes and descriptions

Parameters

Parameter
Type
Description
Example
Required   
tokenstringAll Web Services require a token. This can be generated at http://dmas.uvic.ca/Profile.Click on the "Web Services" tab and click "Generate Token"token=5ba514e8-1203-428c-8835-879c8173e387
Optional   
propertyCodestring

Return a single Property matching a specific Property Code

  • Device Category Code must be valid and match exactly, including case
  • Specific Device Catgory Codes can be found by simply running the service without this parameter to get a list of all devices
propertyCode=beamposition
propertyNamestring

Return all of the Properties where the Property Name contains a keyword

  • Not case sensitive
  • Contains
propertyName=Temp
descriptionstring

Return all of the Properties where the Description contains a keyword

  • Not case sensitive
  • Contains
description=water
locationCodestring

Return all of the Properties that are available at a specific Location

  • Property Code must be valid and match exactly, including case
  • Specific Location Codes can be obtained using the locations service
locationCode=BACAX
deviceCategoryCodestring

Return all of the Properties that have devices belonging to a specific Device Category

  • Device Category Code must be valid and match exactly, including case
  • Specific Device Category Codes can be obtained using the deviceCateogries service
deviceCategoryCode=CTD
deviceCode string

Return all of the Properties available on a specific Device.

  • Device Code must be valid and match exactly, including case
  • Specific Device Codes can be obtained from the devices service
 deviceCode=AandOpt0581

 

Response

Example for request: http://data.oceannetworks.ca/api/devices?method=get&token=[YOUR_TOKEN_HERE]&propertyCode=seawatertemperature

Success (HTTP 200)

Returns a list of properties with values for Property Code, Property Name, Description and Units of Measure (UOM), ordered by Property Code

 

[
 {
    "description":"Time: Gregorian days since 19700101T000000Z",
    "propertyCode":"gregoriantime",
    "propertyName":"Gregorian Time",
    "uom":"Gregorian days since 19700101T000000Z"
 },
 {
    "description":"Magnetic Heading",
    "propertyCode":"magneticheading",
    "propertyName":"Magnetic Heading",
    "uom":"deg"
 },
 {
    "description":"Pitch",
    "propertyCode":"pitch",
    "propertyName":"Pitch",
    "uom":"deg"
 },
 {
    "description":"Pressure",
    "propertyCode":"pressure",
    "propertyName":"Pressure",
    "uom":"decibar"
 },
 {
    "description":"Roll",
    "propertyCode":"roll","propertyName":"Roll","uom":"deg"},{"description":"Temperature: sea water","propertyCode":"seawatertemperature","propertyName":"Sea Water Temperature","uom":"C"},{"description":"Sound Speed: sound velocity sensor","propertyCode":"soundspeed","propertyName":"Sound Speed","uom":"m/s"},{"description":"Voltage: voltage sensor","propertyCode":"voltage","propertyName":"Voltage","uom":"V"}]
Property
Type
Description
Example
descriptionstringReturns a description of the property
"description":"Pressure"
propertyCodestringReturns the property code"propertyCode":"pressure"
propertyNamestringReturns the property name.
"propertyName":"Pressure"
uomstringReturns the Unit Of Measure that the property measurements are in
"uom":"decibar"

Bad Request (HTTP 400)

errorCode
errorMessage
Description
127Invalid parameter value

Occurs when an invalid code is used in the filter. Most filters require an exact match, otherwise this error will occur.

  • The name of the filter parameter will be included in the "parameter" property
129Invalid parameter name

Occurs when a filter parameter is used, but is not supported.

 

 URL Examples

  • Return a list of All of the Properties (no filters)

http://data.oceannetworks.ca/api/properties?method=get&token=[YOUR_TOKEN_HERE]

 

  • Return the Property with a Property Code of 'seawatertemperature'

http://data.oceannetworks.ca/api/properties?method=get&token=[YOUR_TOKEN_HERE]&propertyCode=seawatertemperature

 

  • Return a list of all of the Properties that have a Name which contains 'pressure'

http://data.oceannetworks.ca/api/properties?method=get&token=[YOUR_TOKEN_HERE]&propertyName=pressure

 

  • Return a list of all of the Properties that are available at a location with a Location Code of 'BACAX' ('Barkely Canyon Axis (POD1)')

http://data.oceannetworks.ca/api/properties?method=get&token=[YOUR_TOKEN_HERE]&locationCode=BACAX

 

  • Return a list of all of the Properties that are available for a device with a Device Code of 'NORTEKAQDPRO8398'

http://data.oceannetworks.ca/api/properties?method=get&token=[YOUR_TOKEN_HERE]&deviceCode=NORTEKAQDPRO8398

 

  • Return a list of all of the Properties that are available for instruments with a Device Category of 'ADCP2MHZ'

http://data.oceannetworks.ca/api/properties?method=get&token=[YOUR_TOKEN_HERE]&deviceCategoryCode=ADCP2MHZ

 

*NOTE: The http://data.oceannetworks.ca/apiproxy/properties url used in the above examples can be used in a browser for sharing or testing purposes; however, it can not be used from code, as it redirects to a login screen to capture your user id. In order to use the properties endpoint from code, you must use the http://data.oceannetworks.ca/api/properties url along with a valid token. Attempting to use the apiproxy url from code will result html returned in the payload which may cause errors or unexpected behavior.

 

Code Examples

How-to article

Provide step-by-step guidance for completing a task.

  • No labels