Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update dateFrom and dateTo descriptions and examples. Touch up other get method parameter descriptions.

...

The primary purpose for the locations service is to find locations that have the data you are interested in and use the locationCode when requesting a data product using the dataProductDelivery web service.

 


URL

https://data.oceannetworks.ca/api/locations

...

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/timeDate Time format: .

Accepted DateTime formats:

  • yyyy-MM-dd'T'HH:mm:ss.SSS'Z'

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

dateTodatetime

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

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

Date Time format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'

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

  • ISO8601 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 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 Durations)

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

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

  • ISO8601 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 format will not be accepted.

dateTo=2016-08-01T00:00:00.000Z: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 sensitiveContains.
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 Location in the results.

  • Requires a valid locationCode.
  • Valid values are either true or false.
includeChildren=true


Response

...

errorCode

errorMessage

Description

23Invalid Time Range, Start Time is greater that End Time or start time is not provided

Occurs when the dateTo is before the dateFrom date/time.

  • The name of both of the datetime filters will be included in the "parameter" property
25

Invalid Time Range, Start Time is in the future.

Occurs when the dateFrom is in the future.

  • The name of both of the datetime filters will be included in the "parameter" property
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
128Missing parameter

Occurs when multiple parameters are needed, but not all are present. Occurs when dateFrom is used without dateTo or vice versa

  • The names of the required filter parameters will be included in the "parameter" property separated by /
129Invalid parameter name

Occurs when a filter parameter is in the query but is not supported.

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

...



getTree

The getTree method returns a hierarchical representation of the ONC Search Tree Nodes. The Search Tree is used in Oceans 2.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. 

...

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

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
locationCode=BACAX

 



Response

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

...

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 in the query but is not supported.

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

...



Examples

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

https://data.oceannetworks.ca/api/locations?method=get&token=YOUR_TOKEN_HERE

...


  • Return the Location with a Location Code of 'BACAX' ('Barkely Canyon Axis (POD1)')

https://data.oceannetworks.ca/api/locations?method=get&token=YOUR_TOKEN_HERE&locationCode=BACAX 


  • Return a list of all of the Locations including and below a location in the Tree View, with a Location Code of 'NEP' ('Northeast Pacific')

...

  • This example returns the NEP location and all of it's child locations, in a flat format. The "hasDeviceData" and "hasPropertyData" properties in the results indicate if there is data at that location. If both values are false, the location is a hierarchical tree node.

...


  • Return a list of all of the Locations that have a Location Name which contains 'underwater'

...

https://data.oceannetworks.ca/api/locations?method=get&token=YOUR_TOKEN_HERE&deviceCategoryCode=ADCP2MHZ 


  • Return a list of all of the Locations with a Property Code of 'differentialtemperature'

https://data.oceannetworks.ca/api/locations?method=get&token=YOUR_TOKEN_HERE&propertyCode=differentialtemperature 


  • Return a list of all of the Locations with a Device Category Code of 'CTD' and Property Code of 'pressure'

https://data.oceannetworks.ca/api/locations?method=get&token=YOUR_TOKEN_HERE&deviceCategoryCode=CTD&propertyCode=pressure 


  • Return a list of all of the Locations where a device with a Device Code of 'NORTEKAQDPRO8398' has been deployed

https://data.oceannetworks.ca/api/locations?method=get&token=YOUR_TOKEN_HERE&deviceCode=NORTEKAQDPRO8398

 


  • Return a list of all of the Locations that have instruments that support the Data Product Code of 'IBPP' ('Ice Buoy Profile Plots')

https://data.oceannetworks.ca/api/locations?method=get&token=YOUR_TOKEN_HERE&dataProductCode=IBPP 


  • Return a list of all of the Locations that have instruments that were Deployed Between July 1st 2010 and June 30th 2012

https://data.oceannetworks.ca/api/locations?method=get&token=YOUR_TOKEN_HERE&dateFrom=2010-07-01T00:00:00.000Z&dateTo=2012-06-30T23:59:59.999Z 


  • Return a list of all of the Locations which has instruments Deployed Between July 1st 2010 and June 30th 2011 with a sensor with the Property Code of 'seawatertemperature'

https://data.oceannetworks.ca/api/locations?method=get&token=YOUR_TOKEN_HERE&dateFrom=2010-07-01T00:00:00.000Z&dateTo=2011-06-30T23:59:59.999Z&propertyCode=seawatertemperature 


  • Return the complete DMAS Search Tree hierarchy

...

https://data.oceannetworks.ca/api/locations?method=getTree&token=YOUR_TOKEN_HERE&locationCode=ONC

 


  • Return the DMAS Search Tree hierarchy from the 'Mobile Platforms' node and below

https://data.oceannetworks.ca/api/locations?method=getTree&token=YOUR_TOKEN_HERE&locationCode=MOBP 


API Proxy

The https://data.oceannetworks.ca/apiproxy/locations URL link in the above examples can be used in a browser for sharing or testing purposes; however, it can not be accessed from code. Calls to the apiproxy server are redirected to a login screen to capture your user id. Accessing the apiproxy URL from code will return html in the payload, which may cause errors or unexpected behavior. In order to use the deployments endpoint from code, you must use the https://data.oceannetworks.ca/api/locations url along with a valid token. 

...

Content Report Table
blueprintModuleCompleteKeycom.atlassian.confluence.plugins.confluence-knowledge-base:kb-how-to-article-blueprint
contentBlueprintId5fdbc098-f47d-4b1d-bd32-eb876051b73b
analyticsKeykb-how-to-article
blankDescriptionProvide step-by-step guidance for completing a task.
blankTitleHow-to article
spacesO2A
createButtonLabelAdd how-to article
labelssample-code-locations

 

...



Warning

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

...