Reports

GET /api/reports/

Get the available report types.

Example response:

Returns:

an object mapping report type IDs to objects, each with:

  • the report_type (same as the key)

  • the title and description strings of the report

  • a params array of parameter name strings

  • a result_type of “html” or “spreadsheet”

  • an array of tags that apply to the report (for visual grouping). These tags are currently used:
    • financial

    • personnel

    • production

    • tools

GET /api/reports/(report_type)/run

Run the specified report.

Values for the parameters listed in the report type’s params should be sent in the URL as query parameters for GET requests or in the request body as a JSON object for POST requests (with Content-Type: application/json).

Errors will be returned as an HTML page for GET requests or as a JSON object for POST requests.

Note

If a machine_tags parameter is provided, the machines parameter becomes optional, and any list provided for the machines parameter will be expanded to include machines having any of the tags specified in the machine_tags parameter.

Returns:

an HTML document or Microsoft Excel workbook file. The Content-Type and Content-Disposition response headers can be used to determine the result type.

Status Codes:
POST /api/reports/(report_type)/run

Run the specified report.

Values for the parameters listed in the report type’s params should be sent in the URL as query parameters for GET requests or in the request body as a JSON object for POST requests (with Content-Type: application/json).

Errors will be returned as an HTML page for GET requests or as a JSON object for POST requests.

Note

If a machine_tags parameter is provided, the machines parameter becomes optional, and any list provided for the machines parameter will be expanded to include machines having any of the tags specified in the machine_tags parameter.

Returns:

an HTML document or Microsoft Excel workbook file. The Content-Type and Content-Disposition response headers can be used to determine the result type.

Status Codes:
GET /api/reports/scheduled

Get all existing scheduled reports.

Returns:

an object mapping scheduled report ID to ScheduledReport object

POST /api/reports/scheduled/preview

Get the next few times when the provided schedule would run.

Query Parameters:
  • count (int) – how many future times to get (defaults to 1)

Reqjson:

the scheduling fields of a ScheduledReport object

Returns:

an array of count UNIX timestamps

POST /api/reports/scheduled/(int: scheduled_report_id)/run

Run an existing scheduled report now.

Status Codes:
PUT /api/reports/scheduled

Create a new scheduled report.

Reqjson:

a ScheduledReport object

Status Codes:
Returns:

the new ScheduledReport object

PATCH /api/reports/scheduled/(int: scheduled_report_id)

Edit an existing scheduled report.

Status Codes:
  • 404 Not Found – if the specified scheduled report ID is invalid

Returns:

the new state of the scheduled report object

DELETE /api/reports/scheduled/(int: scheduled_report_id)

Delete an existing scheduled report.

Status Codes: