Developers
To connect to Big Sky, you will need your user API token, which you can find on your Settings page.
This token needs to be set as a header with each request. For example, if you're using jQuery:
var token = 'abc1234' // Use your token here.
$.ajaxSetup({
beforeSend: function(xhr) {
return xhr.setRequestHeader("Authorization", "Token " + token);
}
});
You can then make requests to the API, for example:
// List all maps
$.getJSON('//bigsky.io/api/maps', function(data) {
console.log(data.maps); // [{ name: "Untitled map", ... }, ...]
});
// Create new map from CSV
$.ajax({
type: "POST",
url: "//bigsky.io/api/maps/create_from_csv",
data: {
csv_file_url: "http://netengine-assets.s3.amazonaws.com/numbers.csv"
},
success: function(data) {
console.log("New map url: " + data.url)
}
});
API Endpoints
-
Maps
GET /api/maps/ # List all your maps GET /api/maps/:id # List information about a given map
Create map from CSV file (see example above)
POST /api/maps/create_from_csv # Create new map with provided :csv_file_url parameter
-
Layers
GET /api/maps/:map_id/layers # List all layers for a given map POST /api/maps/:map_id/layers # Create a new layer for a given map GET /api/maps/:map_id/layers/:id # List information about a given layer POST /api/maps/:map_id/layers/:id # Update a given layer DELETE /api/maps/:map_id/layers/:id # Delete a given layer
-
Points
GET /api/maps/:map_id/layers/:layer_id/points # List all points for a given layer POST /api/maps/:map_id/layers/:layer_id/points # Create a new point for a given layer GET /api/maps/:map_id/layers/:layer_id/points/:id # List information about a given point POST /api/maps/:map_id/layers/:layer_id/points/:id # Update a given point DELETE /api/maps/:map_id/layers/:layer_id/points/:id # Delete a given point