Skip to content
asyrjasalo edited this page Apr 24, 2012 · 35 revisions

JSON API

Getting all the hotspots near some location

HTTP method: GET

curl http://wpoint.herokuapp.com/api/v1/spots.json?latitude=62&longitude=26

This gets all the hotspots in requested location (latitude, longitude) within 200 meters. 200 meters is the default setting in the server.

Response

Radius can be given as an optional parameter

curl http://wpoint.herokuapp.com/api/v1/spots.json?latitude=62&longitude=26&radius=100

This gets all the hotspots in requested location (latitude, longitude) within 100 meters.

Reporting all the found hotspots in your location

HTTP method: POST

curl -X POST -F "data={ "latitude" : 62.00000000000000, "longitude" : 26.00000000000000, "results": [ { "bssid" : "F0:F0:F0:F0:F0:F0", "ssid" : "EpicWLAN", "dbm" : -10, "open" : true }, { "bssid" : "11:11:11:11:11:11", "ssid" : "Free", "dbm" : -20, "open" : true }, { "bssid" : "AA:AA:AA:AA:AA:AA", "ssid" : "Home", "dbm" : -30, "open" : false } ]}" http://wpoint.herokuapp.com/api/v1/report.json

Response

HTTP status: 201 Content: { "message": "Reports created."}

HTTP status: 500 Content: { "message": "Saving report failed: <error message>." }**

Clone this wiki locally