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
titleanddescriptionstrings of the reporta
paramsarray of parameter name stringsa
result_typeof “html” or “spreadsheet”- an array of
tagsthat apply to the report (for visual grouping). These tags are currently used: financialpersonnelproductiontools
- an array of
- 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_tagsparameter is provided, themachinesparameter becomes optional, and any list provided for themachinesparameter will be expanded to include machines having any of the tags specified in themachine_tagsparameter.- Returns:
an HTML document or Microsoft Excel workbook file. The
Content-TypeandContent-Dispositionresponse headers can be used to determine the result type.- Status Codes:
404 Not Found – if the report type is unknown
400 Bad Request – if any required parameters are invalid or missing
500 Internal Server Error – if there is an error while generating the report
- 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_tagsparameter is provided, themachinesparameter becomes optional, and any list provided for themachinesparameter will be expanded to include machines having any of the tags specified in themachine_tagsparameter.- Returns:
an HTML document or Microsoft Excel workbook file. The
Content-TypeandContent-Dispositionresponse headers can be used to determine the result type.- Status Codes:
404 Not Found – if the report type is unknown
400 Bad Request – if any required parameters are invalid or missing
500 Internal Server Error – if there is an error while generating the report
- 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
countUNIX timestamps
- POST /api/reports/scheduled/(int: scheduled_report_id)/run
Run an existing scheduled report now.
- Status Codes:
404 Not Found – if the specified scheduled report ID is invalid
204 No Content – on success
424 Failed Dependency – if there was an error
- PUT /api/reports/scheduled
Create a new scheduled report.
- Reqjson:
a ScheduledReport object
- Status Codes:
201 Created – on success
400 Bad Request – if a required field is missing
- 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:
204 No Content – on success
404 Not Found – if the specified scheduled report ID is invalid