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

Compare with Current View Page History

« Previous Version 5 Next »

Description

The API dataProducts service returns all the data products defined in DMAS that meet a filter criteria.

Data Products are downloadable representations of ONC observation data, 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 (extensions) are available for the Locations, Devices, Device Categories or Properties of interest and use the dataProductCode and extension when requesting a data product using 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 the External Web Services for method and token usage and error messages.

URL

http://dmas.uvic.ca/api/dataProducts

Method

Description

Example

get

Retrieve a list Data Products codes

method=get

 get

The get method retrieves a list of Data Product codes 

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   
dataProductCodestring

Return all of the Data Product Extensions matching a specific Data Product Code

  • Data Product Code must be valid and match exactly, including case
dataProductCode=annotationfile
extensionstring

Return all of the Data Products that have a specific Extension

  • Extension must be valid and match exactly, including case
extension=csv
dataProductNamestring

Return all of the Data Products where the Data Product Name contains a keyword

  • Data Product Name is Not case sensitive
  • Contains
dataProductName=Annotation
locationCodestring

Return all of the Data Products that are available for a specific Location

  • Location 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 Data Products that are available for 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=ADCP2MHZ
deviceCodestring

Return all Data Products that are available for 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
propertyCodestring

Return all of the Data Products that are available for a specific Property

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

Response

Example for request http://dmas.uvic.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 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
dataProductCodestringReturns the data product code
"dataProductCode":"TSSD"
dataProductName
stringReturns the name of the data product
"dataProductName":"Time Series Scalar Data"
extension
stringReturns the extension for that data product
"extension":"json"
helpDocument
stringReturns a Link URL to the ONC Help documentation for the specific Data Product
"helpDocument":"https://wiki.oceannetworks.ca/display/DP/1"

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.

 

 Examples

  • Return a list of All of the Data Product Extensions (no filters)

http://dmas.uvic.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]

 

  • Return a list of all of the Data Product Extensions available for a Data Product Code of 'TSSD' (Time Series Scalar Data)

http://dmas.uvic.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]&dataProductCode=TSSD

 

  • Return a list of all of the Data Products Extensions available for an Extension of 'pdf'

http://dmas.uvic.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]&extension=pdf

 

  • Return a list of all of the Data Products Extensions available for a Data Product Code of 'TSSD' (Time Series Scalar Data) and an Extension of 'csv'

http://dmas.uvic.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]&dataProductCode=TSSD&extension=csv

 

  • Return a list of all of the Data Product Extension that have a Data Product Name which contains 'scalar'

http://dmas.uvic.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]&dataProductName=scalar

 

  • Return a list of all of the Data Product Extensions that are available for instruments at a location with a Location Code of 'BACAX' ('Barkely Canyon Axis (POD1)')

http://dmas.uvic.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]&locationCode=BACAX

 

  • Return a list of all of the Data Products with an Extension of 'mat' that are available for instruments at a location with a Location Code of 'BACAX' ('Barkely Canyon Axis (POD1)')

http://dmas.uvic.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]&extension=mat&locationCode=BACAX

 

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

http://dmas.uvic.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]&deviceCode=NORTEKAQDPRO8398

 

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

http://dmas.uvic.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]&deviceCategoryCode=ADCP2MHZ

 

  • Return the Data Products Extensions available for a Property Code of 'seawatertemperature'

http://dmas.uvic.ca/api/dataProducts?method=get&token=[YOUR_TOKEN_HERE]&propertyCode=seawatertemperature

 

*NOTE: The http://dmas.uvic.ca/apiproxy/dataProducts 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 dataProducts endpoint from code, you must use the http://dmas.uvic.ca/api/dataProducts 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.

  • No labels