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 (Login sessions).

    • Get all (/data-sub/api/loginsession/?format=json).
    • Get a single record (/data-sub/api/loginsession/1/?format=json)
    • You can also filter login sessions through a number of parameters:
      • name - add &name=Simon Walton for example
      • employee_id - add &employee_id=SW001 for example
  • employee (Employees).

    • Get all (/data-sub/api/employee/?format=json)
    • Get a single record (/data-sub/api/employee/1/?format=json)
    • You can also filter login sessions through a number of parameters:
      • name - add &name=Simon Walton for example
      • employee_id - add &employee_id=SW001 for example
  • communications (Email/Web Communications).

    • Get all (/data-sub/api/communications/?format=json) |
    • Get a single record (/data-sub/api/communications/1/?format=json)
    • You can also filter login sessions through a number of parameters:
      • communicationType - add &communicationType=E for email &communicationType=W for web records
      • employee_id - e.g. &employee_id=SW001
      • source - add &source=insider@gmail.com
      • destination - add &destination=j.dory@yahoo.com
  • devices (Device Insertions).

    • Get all (/data-sub/api/device/?format=json).
    • Get a single record (/data-sub/api/device/1/?format=json)
  • contract (Employee Contracts).

    • Get all (/data-sub/api/contract/?format=json)
    • Get a single record (/data-sub/api/contract/1/?format=json)
  • department (Departments).

    • Get all (/data-sub/api/department/?format=json)
    • Get a single record (/data-sub/api/department/1/?format=json)
  • employeecontact (Departments).

    • Get all (/data-sub/api/employeecontact/?format=json)
    • Get a single record (/data-sub/api/employeecontact/1/?format=json)

Clone this wiki locally