Description
The API devices returns all the devices defined in DMAS which meet a filter criteria.
Devices are instruments that have one or more sensors that observe a property or phenomenon with a goal of producing an estimate of the value of a property. Properties are uniquely identified by a device code and can be deployed at multiple locations during their lifespan.
The primary purpose of the devices service, is to find devices that have the data you are interested in and use the deviceCode when requesting a data product using the dataProductDelivery web service.
See the External Web Services for method, token, and responseType usage and error messages.
URL
http://dmas.uvic.ca/api/devices
Method | Description | Example |
---|---|---|
get | Retrieve a list of all devices |
|
get
The get method retrieves a list of devices with deviceId, deviceCode, and deviceName
Parameters
Parameter | Type | Description | Example |
---|---|---|---|
Required | |||
token | string | All 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 | |||
deviceCode | string | Return a single Device matching a specific Device Code
| deviceCode=FSINXIC1622 |
deviceName | string | Return all of the Devices where the Device Name contains a keyword
| deviceName=meter |
locationCode | string | Return all Devices that are deployed at a specific Location
| locationCode=BACAX |
deviceCategoryCode | string | Return all Devices belonging to a specific Device Category
| deviceCategoryCode=CTD |
propertyCode | string | Return all Devices that have a sensor for a specific Property
| propertyCode=pressure |
dataProductCode | string | Return all Devices that have the ability to return a specific Data Product
| dataProductCode=jpgfile |
deploymentBegin | datetime | Return all of the Devices that have a Deployment Beginning on or after a specific date/time
Date Time format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
| deploymentBegin=2010-07-27T00:00:00.000Z |
deploymentEnd | datetime | Return all of the Devices that have a Deployment Ending on or before a specific date/time
Date Time format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
| deploymentEnd=2016-08-01T00:00:00.000Z |
Response
Example for request: http://dmas.uvic.ca/api/devices?method=get&token=[YOUR_TOKEN_HERE]&deviceCategoryCode=ADCP2MHZ
Success (HTTP 200)
Returns a list of devices with values for Device Code, Device Id, Device Name and Device Link URL, ordered by Device Code
[{ "deviceCode" : "BC_POD1_AD2M" , "deviceId" :11302, "deviceLink" : "http://dmas.uvic.ca/DeviceListing?DeviceId=11302" , "deviceName" : "Nortek Aquadopp HR-Profiler 2965" }, { "deviceCode" : "NortekADCP1504" , "deviceId" :22666, "deviceLink" : "http://dmas.uvic.ca/DeviceListing?DeviceId=22666" , "deviceName" : "Nortek Aquadopp Profiler AQD 1504 on Crawler" }, { "deviceCode" : "NORTEKADCP9917" , "deviceId" :23081, "deviceLink" : "http://dmas.uvic.ca/DeviceListing?DeviceId=23081" , "deviceName" : "Nortek Aquadopp Profiler AQD 9917" }, { "deviceCode" : "NORTEKAQDPRO2751" , "deviceId" :23164, "deviceLink" : "http://dmas.uvic.ca/DeviceListing?DeviceId=23164" , "deviceName" : "Nortek Aquadopp Profiler AQD 2751" }, { "deviceCode" : "NORTEKAQDPRO2786" , "deviceId" :23163, "deviceLink" : "http://dmas.uvic.ca/DeviceListing?DeviceId=23163" , "deviceName" : "Nortek Aquadopp Profiler AQD 2786" }, { "deviceCode" : "NORTEKAQDPRO2958" , "deviceId" :20002, "deviceLink" : "http://dmas.uvic.ca/DeviceListing?DeviceId=20002" , "deviceName" : "Nortek Aquadopp Profiler AQD 2958" }, { "deviceCode" : "NORTEKAQDPRO8398" , "deviceId" :520, "deviceLink" : "http://dmas.uvic.ca/DeviceListing?DeviceId=520" , "deviceName" : "Nortek Aquadopp Profiler AQD 8398" }, { "deviceCode" : "NORTEKAQDPRO8455" , "deviceId" :23117, "deviceLink" : "http://dmas.uvic.ca/DeviceListing?DeviceId=23117" , "deviceName" : "Nortek Aquadopp Profiler AQD 8455" }, { "deviceCode" : "NTAquadoppHRCP2973" , "deviceId" :11203, "deviceLink" : "http://dmas.uvic.ca/DeviceListing?DeviceId=11203" , "deviceName" : "Nortek Aquadopp HR-Profiler 2973" }, { "deviceCode" : "NTAquadoppHRCP2978" , "deviceId" :12003, "deviceLink" : "http://dmas.uvic.ca/DeviceListing?DeviceId=12003" , "deviceName" : "Nortek Aquadopp HR-Profiler 2978" }] |
Property | Type | Description | Example |
---|---|---|---|
deviceCode | string | Returns the device code | "deviceCode":"BC_POD1_AD2M" |
deviceId | integer | Returns the device id | "deviceId":11302 |
deviceName | string | Returns the device name | "deviceName":"Nortek Aquadopp HR-Profiler 2965" |
deviceLink | url | Returns the a URL link to Device Listing page for the specific device | "deviceLink":"http://dmas.uvic.ca/DeviceListing?DeviceId=11302" |
Bad Request (HTTP 400)
errorCode | errorMessage | Description |
---|---|---|
23 | Invalid Time Range, Start Time is greater that End Time or start time is not provided | Occurs when the deploymentEnd is before the deploymentBegin date/time.
|
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.
|
128 | Missing parameter | Occurs when multiple parameters are needed, but not all are present. Occurs when deploymentBegin is used without deploymentEnd
|
129 | Invalid parameter name | Occurs when a filter parameter is used, but is not supported. |
Examples
- Return a list of All of the Devices (no filters)
http://dmas.uvic.ca/api/devices?method=get&token=[YOUR_TOKEN_HERE]
- Return the Device with a Device Code of 'NORTEKADCP9917'
http://dmas.uvic.ca/api/devices?method=get&token=[YOUR_TOKEN_HERE]&deviceCode=NORTEKADCP9917
- Return a list of all of the Devices that have a Device Name which contains 'JASCO'
http://dmas.uvic.ca/api/devices?method=get&token=[YOUR_TOKEN_HERE]&deviceName=JASCO
- Return a list of all of the devices that have been deployed at a location with a Location Code of 'BACAX' ('Barkely Canyon Axis (POD1)')
http://dmas.uvic.ca/api/devices?method=get&token=[YOUR_TOKEN_HERE]&locationCode=BACAX
- Return a list of all of the Devices with a Device Category of 'ADCP2MHZ'
http://dmas.uvic.ca/api/devices?method=get&token=[YOUR_TOKEN_HERE]&deviceCategoryCode=ADCP2MHZ
- Return a list of all of the Devices with a Property Code of 'oxygen'
http://dmas.uvic.ca/api/devices?method=get&token=[YOUR_TOKEN_HERE]&propertyCode=oxygen
- Return a list of all of the Devices with a Device Category of 'CTD' and Property Code of 'pressure'
- Return a list of all of the Devices that support the Data Product Code of 'IBPP' ('Ice Buoy Profile Plots')
http://dmas.uvic.ca/api/devices?method=get&token=[YOUR_TOKEN_HERE]&dataProductCode=IBPP
- Return a list of all of the Devices that were Deployed Between July 1st 2010 and June 30th 2012
- Return a list of all of the Devices Deployed Between July 1st 2010 and June 30th 2011, at a location with a Location Code of 'BACAX' ('Barkely Canyon Axis (POD1)')
- Return a list of all of the Devices which have a Property Code of 'seawatertemperature', at a location with a Location Code of 'BACAX' ('Barkely Canyon Axis (POD1)'), Deployed Between July 1st 2010 and June 30th 2011
*NOTE: The http://dmas.uvic.ca/apiproxy/devices 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 devices endpoint from code, you must use the http://dmas.uvic.ca/api/devices 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.