Skip to content
Harshita edited this page Nov 1, 2015 · 13 revisions

#Welcome to the binWatch wiki!

Web URL : http://binwatch-ghci.rhcloud.com/

Requirements Doc : http://www.acehacker.com/ghci2015/project3.pdf

API REFERENCE

1. GET all bins

  • Returns all the bins (default limit 15)

    URL : [BASE_URL]/get/bins

    METHOD : GET

    Response Format : https://api.myjson.com/bins/3omdc

    http://binwatch-ghci.rhcloud.com/get/bins

  • Returns bins for a page (page limit 15)

    URL : [BASE_URL]/get/bins/page/:pagenumber

    METHOD : GET

    Response Format : https://api.myjson.com/bins/3omdc

    http://binwatch-ghci.rhcloud.com/get/bins/page/1

  • Returns bins for a page and specify custom page limit (max page limit 15)

    URL : [BASE_URL]/get/bins/page/:pagenumber/:limit

    METHOD : GET

    Response Format : https://api.myjson.com/bins/3omdc

    http://binwatch-ghci.rhcloud.com/get/bins/page/1/3

2. GET a bin detail

URL : http://binwatch-ghci.rhcloud.com/get/bin/:id

METHOD : GET

Response Format : https://api.myjson.com/bins/4zrwg

3. GET bins near a location **

  • Returns all the bins (default limit 15)

    URL : [BASE_URL]/get/bins/:latitude/:longitude

    METHOD : GET

    Response Format : https://api.myjson.com/bins/3omdc

    http://binwatch-ghci.rhcloud.com/get/bins/12.92/77.60

  • Returns bins for a page (page limit 15)

    URL : [BASE_URL]/get/bins/:latitude/:longitude/page/:pagenumber

    METHOD : GET

    Response Format : https://api.myjson.com/bins/3omdc

    http://binwatch-ghci.rhcloud.com/get/bins/12.92/77.60/page/1

  • Returns bins for a page and specify custom page limit (max page limit 15)

    URL : [BASE_URL]/get/bins/:latitude/:longitude/page/:pagenumber/:limit

    METHOD : GET

    Response Format : https://api.myjson.com/bins/3omdc

    http://binwatch-ghci.rhcloud.com/get/bins/12.92/77.60/page/1/3

4. GET bin sensor activity

  • Returns sensor data of the bin the bins (default limit 15)

    URL : [BASE_URL]/get/bin/:id/activity

    METHOD : GET

    Response Format : https://api.myjson.com/bins/3omdc

    http://binwatch-ghci.rhcloud.com/get/bin/562115d1990b1b59a5000001/activity

  • Returns sensor data of the bin for a page (page limit 15)

    URL : [BASE_URL]/get/bin/:id/activity/page/:pagenumber

    METHOD : GET

    Response Format : https://api.myjson.com/bins/3omdc

    http://binwatch-ghci.rhcloud.com/get/bin/562115d1990b1b59a5000001/activity/page/1

  • Returns sensor data of the bin for a page and specify custom page limit (max page limit 15)

    URL : [BASE_URL]/get/bin/:id/activitypage/:pagenumber/:limit

    METHOD : GET

    Response Format : https://api.myjson.com/bins/3omdc

    http://binwatch-ghci.rhcloud.com/get/bin/562115d1990b1b59a5000001/activity/page/1/3

5. GET bin sensor activity over a time range

URL : http://binwatch-ghci.rhcloud.com/get/bin/:id/activity

METHOD : POST

PARAMS :

 `start`: Start Date

 `end`: End Date

 `param`: bin attribute (humidity|temperature) `Optional`

6. Predict bin next fill time

URL : http://binwatch-ghci.rhcloud.com/get/bin/:id/prediction

METHOD : GET

Note : Pagination params for time range api are same as for all the api's

Error Status Codes

400 : If the input is not correct

 {
     "errorCode": 102,
     "errorText": "Invalid Input"
 }

** : https://github.com/hkasera/binWatch/wiki/How-nearby-bins-are-calculated%3F