Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The best way to get datapoints by sensor id in the example below.

Jupyter Notebook

geostreams_jupyter.ipynb

Create an Account 

...

    • ema

Jupyter Notebook

geostreams_jupyter.ipynb

Examples using Curl

taskcurlinputsinstructions
get all sensorscurl -X GET -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H 'Connection: keep-alive' -H 'User-Agent: python-requests/2.19.1' --compressed https://greatlakestogulf.org/geostreams/api/sensors

authenticate

curl -X POST -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H 'Connection: keep-alive' -H 'Content-Length: 63' -H 'Content-Type: application/json' -H 'User-Agent: python-requests/2.19.1' -d '{"password": "****", "identifier": "email"}' --compressed -i https://greatlakestogulf.org/geostreams/api/authenticate

  • password
  • email
  • url
In the response will be X-Auth-Token: followed by the alphanumeric security token
get all datapoints for a single sensor

curl -X GET -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H 'Connection: keep-alive' -H 'Content-Encoding: application/json' -H 'User-Agent: python-requests/2.19.1' -H 'x-auth-token: token' --compressed 'https://greatlakestogulf.org/geostreams/api/datapoints?sensor_id=22'


  • token
  • url
Use token from authentication

Authentication session for API use

taskstepdetailsdescriptioncurlpython exampleauthenticatecreate useruser = {'identifier': 'email', 'password': '******'}r = requests.post(api_server + '/api/authenticate', data=json.dumps(user), headers={'Content-Type': 'application/json'}create headersheaders={'Content-Type': 'application/json'}requesthttps://greatlakestogulf.org/geostreams/api/authenticateadd user and headers to requestget token headers = {"x-auth-token": r.headers["x-auth-token"], "Content-Encoding": "application/json"}headers = {"x-auth-token": r.headers["x-auth-token"], "Content-Encoding": "application/json"}add headers to api requests