Versions Compared

Key

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

...

The API locations discovery web service returns all the locations defined in Oceans 23.0 that meet a set of filter criteria.

A location is the parent of an Oceans 23.0 Tree Node from which you can get data. In the Oceans 23.0 Data Search GUI, a location is a Tree Node that contains device categories (Instruments by Location) or properties (Variables by Location) that can be selected to download data. From the Oceans 23.0 perspective, a location is a Search Tree Node that has one or more site devices and/or has one or more primary sensors. If there are multiple instruments of the same device category at a location, child locations or pseudo-nodes will exist and can be pulled from any one of them. Device Categories can be either at the location or at the child-level, whereas Properties (variables) can only be at the location level, due to the "Primary Sensor" concept, which stitches together data from multiple sensors over time at a location.

...

Parameter

Type

Description

Example

Required


tokenstringAll Web Services require a token. This can be generated at https://data.oceannetworks.ca/Profile. Click on the "Web Services" tab and click "Generate Token".token=YOUR_TOKEN_HERE
Optional


locationCodestring

Return a single Location matching a specific Location Code.

  • Location Code must be valid and match exactly, including case.
  • Specific Location Codes can be found by simply running the service without this parameter to get a list of all locations.
locationCode=BACAX
deviceCategoryCodestring

Return all Locations that have devices with a specific Device Category Code.

  • Device Category Code must be valid and match exactly, including case.
  • Specific Device Category Codes can be obtained using the deviceCategories service.
deviceCategoryCode=CTD
propertyCodestring

Return all Locations that have devices with a sensor with a specific Property Code.

  • Property Code must be valid and match exactly, including case.
  • Specific Property Codes can be obtained using the properties service.
propertyCode=differentialtemperature
dataProductCodestring

Return all of the Locations that support a specific Data Product Code.

  • Data Product Code must be valid and match exactly, including case.
  • Specific Data Product Codes can be obtained from the dataProducts service.
dataProductCode=CPID
dateFromdatetime

Return all of the Locations that have a Deployment Beginning on or after a specific date/time.

Accepted DateTime formats:

  • yyyy-MM-dd'T'HH:mm:ss.SSS'Z' (ISO 8601 Extended)
  • yyyy-MM-dd (ISO 8601 Extended)
  • PnYnMnDTnHnMnS (ISO 8601 DurationsDuration)

If not specified, the default value is the beginning of time.

  • DateTime is represented in Coordinated Universal Time (UTC).

  • ISO8601 ISO 8601 Extended format without a time will be assumed to mean midnight (T00:00:000.000Z).
  • Queries with both dateFrom and dateTo in the ISO8601 Durations ISO 8601 Duration format will not be accepted.

dateFrom=2010-07-27T00:00:00.000Z

dateFrom=2010-07-27

dateFrom=-P1DT1H

  • Previous 1 day and 1 hour, relative to the dateTo. Note the '-' before the P.
dateTodatetime

Return all of the Locations that have a Deployment Ending before a specific date/time.

Accepted DateTime formats:

  • yyyy-MM-dd'T'HH:mm:ss.SSS'Z' (ISO 8601 Extended)
  • yyyy-MM-dd (ISO 8601 Extended)
  • PnYnMnDTnHnMnS (ISO 8601 DurationsDuration)

If not specified, the default value is the end of time.

  • DateTime is represented in Coordinated Universal Time (UTC).

  • ISO8601 ISO 8601 Extended format without a time will be assumed to mean midnight (T00:00:000.000Z).
  • Queries with both dateFrom and dateTo in the ISO8601 Durations ISO 8601 Duration format will not be accepted.

dateTo=2016-08-01T00:00:00.000Z

dateTo=2016-08-01

dateTo=PT12H30M

  • Next 12 hours and 30 minutes, relative to the dateFrom.
locationNamestring

Return all of the Locations where the Location Name contains a keyword.

  • Not case sensitive.
locationName=mill
deviceCode string

Return all of the Locations where a specific device with that Device Code has been deployed.

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

Include all of the children of a Location in the resultsReturn all Devices that are deployed at a specific Location and sub-tree Locations.

  • Requires a valid locationCode. Location Code
  • Valid values are either true or false.false
  • If not specified, the default value is false
includeChildren=true


Response

...

The getTree method returns a hierarchical representation of the ONC Search Tree Nodes. The Search Tree is used in Oceans 23.0 to organize Instruments and Variables by Location so that users can easily drill down by place name or mobile platform name to find the instruments or properties they are interested in. 

Parameters


Parameter

Type

Description

Example

Required


tokenstringAll Web Services require a token. This can be generated at https://data.oceannetworks.ca/Profile. Click on the "Web Services" tab and click "Generate Token".token=YOUR_TOKEN_HERE
Optional


locationCode
string

A valid locationCode is needed. One can be found by simply running the service without this parameter to get a list of all locations

  • Code must match exactly, including case
string

Return a single Location matching a specific Location Code.

  • Location Code must be valid.
  • Specific Location Codes can be found by simply running the service without this parameter to get a list of all locations.
locationCode=BACAX
deviceCategoryCodestring

Return all Locations that have devices with a specific Device Category Code.

deviceCategoryCode=CTD
propertyCodestring

Return all Locations that have devices with a sensor with a specific Property Code.

  • Property Code must be valid.
  • Specific Property Codes can be obtained using the properties service.
propertyCode=differentialtemperature
dataProductCodestring

Return all of the Locations that support a specific Data Product Code.

  • Data Product Code must be valid.
  • Specific Data Product Codes can be obtained from the dataProducts service.
dataProductCode=CPID
dateFromdatetime

Return all of the Locations that have a Deployment Beginning on or after a specific date/time.

Accepted DateTime formats:

  • yyyy-MM-dd'T'HH:mm:ss.SSS'Z' (ISO 8601 Extended)
  • yyyy-MM-dd (ISO 8601 Extended)
  • PnYnMnDTnHnMnS (ISO 8601 Duration)

If not specified, the default value is the beginning of time.

  • DateTime is represented in Coordinated Universal Time (UTC).

  • ISO 8601 Extended format without a time will be assumed to mean midnight (T00:00:000.000Z).
  • Queries with both dateFrom and dateTo in the ISO 8601 Duration format will not be accepted.

dateFrom=2010-07-27T00:00:00.000Z

dateFrom=2010-07-27

dateFrom=-P1DT1H

  • Previous 1 day and 1 hour, relative to the dateTo. Note the '-' before the P.
dateTodatetime

Return all of the Locations that have a Deployment Ending before a specific date/time.

Accepted DateTime formats:

  • yyyy-MM-dd'T'HH:mm:ss.SSS'Z' (ISO 8601 Extended)
  • yyyy-MM-dd (ISO 8601 Extended)
  • PnYnMnDTnHnMnS (ISO 8601 Duration)

If not specified, the default value is the end of time.

  • DateTime is represented in Coordinated Universal Time (UTC).

  • ISO 8601 Extended format without a time will be assumed to mean midnight (T00:00:000.000Z).
  • Queries with both dateFrom and dateTo in the ISO 8601 Duration format will not be accepted.

dateTo=2016-08-01T00:00:00.000Z

dateTo=2016-08-01

dateTo=PT12H30M

  • Next 12 hours and 30 minutes, relative to the dateFrom.
locationNamestring

Return all of the Locations where the Location Name contains a keyword.

  • Not case sensitive.
locationName=mill
deviceCode string

Return all of the Locations where a specific device with that Device Code has been deployed.

  • Location Code must be valid.
  • Specific Device Codes can be obtained from the devices service.
 deviceCode=AandOpt0581
locationCode=BACAX


Response

Response for request https://data.oceannetworks.ca/api/locations?method=getTree&token=YOUR_TOKEN_HERE&locationCode=BACCC

...

Warning

Please report all issues with the web services, documentation, samples and client libraries to the Oceans 23.0 Help Centre