Accessing the API

These are the API calls available once you have an OAuth Access Token for the Active911 Developer API.

Data format

All responses from the API use the JSON data format. The general structure of a response is

{ "result": (success|error), "message": (error message|returned object) }

API Collections

Agency

https://access.active911.com/interface/open_api/api/

  • This is the root of the API tree.

  • This will display the agency the token is authorized to read.

{ "agency" : { "id": (Agency id number), "name": (Name of the agency), "address": (Street address of the agency), "city": (City agency is located in), "state": (State agency is location in), "latitude": (Latitude of agency's location), "longitude": (Longitude of agency's location), "devices": [ "id": (Device id number), "uri": (API URI to access the device data) ] } }

Devices

https://access.active911.com/interface/open_api/api/devices/{id}

  • This will show information for device #{id}

  • Requires read_device scope

{ "device": { "id": (Device id number), "name": (Name of the device), "latitude": (Latitude of devices's most recent location), "longitude": (Longitude of devices's most recent location), "position_accuracy": (Accuracy of devices's most recent location), "position_timestamp": (Timestamp of devices's most recent location update), "agencies": [ "id": (Agency id number), "uri": (API URI to access the agency data) ] } }

API Sub-collections

Alerts

https://access.active911.com/interface/open_api/api/alerts

https://access.active911.com/interface/open_api/api/devices/{id}/alerts

  • This will show all the alerts under the current agency or under the device specified.

  • Requires read_alert scope

  • GET params:

    • alert_days - How many days of alerts to show. Default 10. Max 30.

    • alert_minutes - How many minutes of alerts to show. Will supersede alert_days if set. Optional.

https://access.active911.com/interface/open_api/api/alerts/{id}

  • This will show alert #{id}

  • Requires read_alert scope

Alert

Map Data

Locations

GET

https://access.active911.com/interface/open_api/api/locations

  • This will show all mapdata under agency {id}

  • Requires read_mapdata scope

  • GET params:

    • locations_page - What page to return. Default 1.

    • locations_per_page - How many locations per page to return. Default 10. Max 1000.

    • locations_coordinate_window - A set of decimal coordinates within which all locations will be returned. Optional.

      • Format: North,East,South,West

      • Example: 44.638368,-123.476136,44.621265,-123.502915

  • count_only - If set to 1, will return a count of the entire resultset instead of locations. Can be used with locations_coordinate_window.

POST

https://access.active911.com/interface/open_api/api/locations

  • This will allow you to add a location to agency {id}

  • Requires write_mapdata scope

  • POST Body form-data (key/value pairs):

    • lat - Latitude

    • lon - Longitude

    • name - name/title

    • description - extended location description

    • location_type - should just be "building" for now

    • icon_color - same as the colors shown on the apps & the website, e.g. "blue|green|red|etc."

    • icon_id - same as the icons shown on the apps & the website, but using the IDs: e.g. "9|13|20|etc."

Example form data: ...

...

GET (by id)

https://access.active911.com/interface/open_api/api/locations/{id}

  • This will show location #{id}

  • Requires read_mapdata scope

Resources

https://access.active911.com/interface/open_api/api/resources/{id}

  • This will show resource #{id}

  • Requires read_mapdata scope