Description
The API dataProducts service returns all data products defined in Oceans 2.0 that meet a filter criteria.
Data Products are downloadable representations of ONC observational data, provided in formats that can be easily ingested by analytical or visualization software.
The primary purpose of this service is to identify which Data Products and Formats (file extensions) are available for the Locations, Devices, Device Categories or Properties of interest. Use the dataProductCode and extension when requesting a data product via the dataProductDelivery web service.
For a list of available data product codes and extensions, along with help document links, see the Available Data Products page.
See External Web Services for method and token usage and error messages.
URL
https://data.oceannetworks.ca/api/dataProducts
Method | Description | Example |
---|---|---|
get | Retrieve a list Data Products codes |
|
get
The get method retrieves a list of Data Product codes
Parameters
Parameter | Type | Description | Example |
---|---|---|---|
Required | |||
token | string | ll Web Services require a token. Once logged in at https://data.oceannetworks.ca/login, your token can be retrieved or generated at https://data.oceannetworks.ca/Profile . Click on the "Web Services" tab, then click "Generate Token". | token=5ba514e8-1203-428c-8835-879c8173e387 |
Optional | |||
dataProductCode | string | Return all Data Product Extensions matching a specific Data Product Code.
| dataProductCode=annotationfile |
extension | string | Return all Data Products that have a specific File Extension.
| extension=csv |
dataProductName | string | Return all Data Products where the Data Product Name contains a keyword.
| dataProductName=time |
locationCode | string | Return all Data Products available for a specific Location.
| locationCode=BACAX |
deviceCategoryCode | string | Return all Data Products available for devices belonging to a specific Device Category.
| deviceCategoryCode=ADCP2MHZ |
deviceCode | string | Return all Data Products available for a specific Device.
| deviceCode=AandOpt0581 |
propertyCode | string | Return all Data Products available for a specific Property.
| propertyCode=airdensity |
Response
Example for request https://data.oceannetworks.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]&deviceCategoryCode=CTD&locationCode=BACAX
Success (HTTP 200)
Returns a list of data product extensions with values for Data Product Code, Data Product Name, Extension and Help Document URL, ordered alphabetically by Data Product Code
[ { "dataProductCode" : "AF" , "dataProductName" : "Annotation File" , "extension" : "an" , "helpDocument" : "https://wiki.oceannetworks.ca/display/DP/89" }, { "dataProductCode" : "LF" , "dataProductName" : "Log File" , "extension" : "txt" , "helpDocument" : "https://wiki.oceannetworks.ca/display/DP/4" }, { "dataProductCode" : "MSQAQCR" , "dataProductName" : "Manual Scalar QAQC Results" , "extension" : "qaqc" , "helpDocument" : "https://wiki.oceannetworks.ca/display/DP/106" }, { "dataProductCode" : "SBCTDRF" , "dataProductName" : "Sea-Bird CTD Raw Files" , "extension" : "hex" , "helpDocument" : "https://wiki.oceannetworks.ca/display/DP/78" }, { "dataProductCode" : "TSSCP" , "dataProductName" : "Time Series Staircase Plot" , "extension" : "pdf" , "helpDocument" : "https://wiki.oceannetworks.ca/display/DP/21" }, { "dataProductCode" : "TSSCP" , "dataProductName" : "Time Series Staircase Plot" , "extension" : "png" , "helpDocument" : "https://wiki.oceannetworks.ca/display/DP/21" }, { "dataProductCode" : "TSSD" , "dataProductName" : "Time Series Scalar Data" , "extension" : "json" , "helpDocument" : "https://wiki.oceannetworks.ca/display/DP/1" }, { "dataProductCode" : "TSSD" , "dataProductName" : "Time Series Scalar Data" , "extension" : "csv" , "helpDocument" : "https://wiki.oceannetworks.ca/display/DP/1" }, { "dataProductCode" : "TSSD" , "dataProductName" : "Time Series Scalar Data" , "extension" : "mat" , "helpDocument" : "https://wiki.oceannetworks.ca/display/DP/1" }, { "dataProductCode" : "TSSD" , "dataProductName" : "Time Series Scalar Data" , "extension" : "txt" , "helpDocument" : "https://wiki.oceannetworks.ca/display/DP/1" }, { "dataProductCode" : "TSSP" , "dataProductName" : "Time Series Scalar Plot" , "extension" : "pdf" , "helpDocument" : "https://wiki.oceannetworks.ca/display/DP/2" }, { "dataProductCode" : "TSSP" , "dataProductName" : "Time Series Scalar Plot" , "extension" : "png" , "helpDocument" : "https://wiki.oceannetworks.ca/display/DP/2" }] |
Property | Type | Description | Example |
---|---|---|---|
dataProductCode | string | Returns the data product code. | "dataProductCode":"TSSD" |
dataProductName | string | Returns the name of the data product. | "dataProductName":"Time Series Scalar Data" |
extension | string | Returns the file extension for the data product. | "extension":"json" |
helpDocument | string | Returns a Link URL to the Oceans 2.0 Help documentation for the specific Data Product. | "helpDocument":"https://wiki.oceannetworks.ca/display/DP/1" |
Bad Request (HTTP 400)
errorCode | errorMessage | Description |
---|---|---|
127 | Invalid parameter value | Occurs when an invalid code is used in the filter. Most filters require an exact match, otherwise this error will occur.
|
129 | Invalid parameter name | Occurs when an unsupported filter parameter is used. |
URL Examples
- Return a list of All Data Product Extensions (no filters)
https://data.oceannetworks.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]
- Return a list of all Data Product Extensions available for Data Product Code 'TSSD' (Time Series Scalar Data)
- Return a list of all Data Products Extensions available for the Extension 'pdf'
https://data.oceannetworks.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]&extension=pdf
- Return a list of all Data Products Extensions available for Data Product Code 'TSSD' (Time Series Scalar Data) and Extension of 'csv'
- Return a list of all Data Product Extension with a Data Product Name containing 'scalar'
- Return a list of all Data Product Extensions available for instruments at the location with Location Code 'BACAX'
https://data.oceannetworks.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]&locationCode=BACAX
- Return a list of all Data Products with the Extension 'mat' that are available for instruments at the location with Location Code 'BACAX'
- Return a list of all Data Product Extensions available for the device with Device Code 'NORTEKAQDPRO8398'
- Return a list of all Data Product Extensions available for instruments with the Device Category 'ADCP2MHZ'
- Return a list of all Data Products Extensions available for the Property Code 'seawatertemperature'
API Proxy
The https://data.oceannetworks.ca/apiproxy/properties 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 behaviour. In order to use the deviceCategories endpoint from code, you must use the https://data.oceannetworks.ca/api/properties url along with a valid token.
Code Examples
How-to article
Provide step-by-step guidance for completing a task.