Accessing BlueWater Data

Code Sample

See sample code in Java (on GitHub) on how to use the APIs:

https://github.com/sandeep-iitr/BlueWater_REST_API_DEMO

Docs

See slides (35-41) in the "AI for Water" tutorial.

API Methods

  1. Generating the license key to use the API.

Go to the below URL, and fill details to generate license key.

https://bluewater.mybluemix.net/license.jsp

  1. General query (gives the metadata)

Sample output

[
{"Total Number of Data Points":147},
{"Sensor Attributes":[{"Time":"hh:mm:ss"},
{"Temperature":"Celcius"},{"pH":"Logarithm"},{"mV":"pH"},{"ORP":"mV"},{"EC":"microSiemens/cm"},{"EC Abs.":"microSiemens/cm"},{"RES":"Ohm-cm"},{"TDS":"ppm"},{"Sal":"psu"},{"Press.":"psi"},{"D.O.":"%"},{"D.O.":"ppm"},{"Latitde":"Degrees"},{"Longitude":"Degrees"},{"Date":"yyyy/mm/dd"},{"Unix Timestamp":"Seconds"}]},{"Lab Attributes":[{"Date":"yyyy/mm/dd"},{"Latitude":"Degrees"},{"Longitude":"Degrees"},{"Temperature":"Celcius"},{"D.O.":"mg/L"},{"pH":"Logarithm"},{"Conductivity":"microSiemens/cm"},{"BOD":"mg/L"},{"Nitrate":"ppm"},{"FC":"Colonies/100ml"},{"TC":"Colonies/100ml"},{"Turbidity":"FNU"},{"Velocity":"m/s"},{"Hardness":"mg/L"},{"Alkalinity":"mg/L"},{"Chloride":"mg/L"},{"Sulphate":"mg/L"},{"Cadmium":"mg/L"},{"Chromium":"mg/L"},{"Nickel":"mg/L"},{"Iron":"mg/L"},{"NA":"mg/L"},{"COD":"mg/L"}]}
]
  1. Get water quality data within the given range (in metres) around the given latitude longitude

Arguments

Sample output

[
{"Lab":[{"Temperature":10.9,"Latitude":29.709368,"Iron":0.76,"FS":230,"Air Temperature":11.1,"Sulphate":88.1,"Chloride":177,"Unix Timestamp":1262284200,"BOD":62.7,"Turbidity":51.7,"pH":7.76,"COD":136,"Cadmium":0.015,"Conductivity":1407,"Hardness":382,"Longitude":77.565482,"Velocity":0.4,"Date":"2010/1/1","TC":2.4E8,"Nitrate":0,"NA":93.6,"D.O.":0.58,"Chromium":0,"Nickel":-1,"Alkalinity":323,"FC":2.4E8},{"Temperature":17.8,"Latitude":29.709368,"Iron":1.95,"FS":9300,"Air Temperature":19.3,"Sulphate":62,"Chloride":123,"Unix Timestamp":1264962600,"BOD":63,"Turbidity":81.5,"pH":7.73,"COD":234,"Cadmium":0.016,"Conductivity":1148,"Hardness":385,"Longitude":77.565482,"Velocity":0.33,"Date":"2010/2/1","TC":2300000,"Nitrate":0,"NA":72,"D.O.":0.31,"Chromium":0.037,"Nickel":0.006,"Alkalinity":367,"FC":2300000},
...
]

Possible Errors

  • Code 1- Wrong values for parameters.
  • Code 2- Inadequate number of parameters.
  • Code 3- License key not valid.

4. Get water quality data between a period of time (Input as unix timestamps)

Arguments

Possible Errors

  • Code 1- Wrong values for parameters.
  • Code 2- Inadequate number of parameters.
  • Code 3- License key not valid.

5. Get water quality data between a period of time (Input as date (date format- yyyy-mm-dd))

Arguments

Date_1

Date_2

Lic

Starting date from which you want data

Ending date till which you want data

API key (Replace the key with the key provided to you)

Possible Errors

  • Code 1- Wrong values for parameters
  • Code 2- Inadequate number of parameters
  • Code 3- License key not valid

6. Get water quality data between a period of time and within the given range around the given latitude longitude

Arguments

Possible Errors

  • Code 1- Wrong values for parameters
  • Code 2- Inadequate number of parameters
  • Code 3- License key not valid

7. Get water quality data between a the dates and within the given range around the given latitude longitude

Arguments

Possible Errors

  • Code 1- Wrong values for parameters
  • Code 2- Inadequate number of parameters
  • Code 3- License key not valid