Skip to content

Getting Data from the Database

eamonnmag edited this page Sep 17, 2014 · 42 revisions

All data in the database can be retrieved from the API as JSON. In fact, all the visualizations are driven by the very same APIs (especially for aggregate information).

API giving access to all RAW data.

The pattern for retrieving data is very simple.

To get all records, the URL is formed as /data-sub/api/<data_type>/?format=json

To get a single record, the URL is formed as /data-sub/api/<data_type>/<id>/?format=json

The available data types are:

  • loginsession - Get all login sessions (/data-sub/api/loginsession/?format=json). Get a single login session (/data-sub/api/loginsession/1/?format=json)

  • employee get all employees (/data-sub/api/employee/?format=json) | get a single employee (/data-sub/api/employee/1/?format=json)

  • communications get all communications (/data-sub/api/communications/?format=json) | get a single employee (/data-sub/api/communications/1/?format=json)

Clone this wiki locally