Public Use Case Manager API workflows

Use these workflows to download report data to CSV or JSON files. For JSON format, you can choose to generate a paginated format or a full report. Paginated files are useful for places where you need JSON, like the user interface, and you need to paginate through the results. You can request page by page and not the whole result set. Full report files are faster to download than the JSON body, but pagination is not available in the file download format.

Select a workflow to download report data.

Workflow to generate a paginated result in JSON

Generate the Use Case Explorer report as a JSON array in a page by page format. This workflow is useful for places where you need JSON, like the user interface, and you need to paginate. You can request page by page and not the whole result set. The workflow is a 3-step process that uses the API endpoints in the order that is described in the following table:
Endpoint Description
POST /api/use_case_explorer Generates a Use Case Explorer report and returns a reportId. You must use this endpoint first when you start report generation. Fill the body of the request with the report columns and any filters or table groupings that you want in the generated report. Use the returned reportId value in other API calls in the workflow.
GET /api/use_case_explorer/{reportId}/status Returns the status of /api/use_case_explorer. Use the endpoint to see whether your report generation succeeded or failed.
GET /api/use_case_explorer/{reportId}/result Returns the result of /api/use_case_explorer in a paginated JSON array. Include the reportId value that is returned from the /api/use_case_explorer endpoint in the path to get your result.

Workflow to generate and download reports in CSV

Generate the Use Case Explorer full report in a CSV format. This workflow is a 5-step process that uses the API endpoints in the order that is described in the following table:

Endpoint Description
POST /api/use_case_explorer Generates a Use Case Explorer report and returns a reportId. You must use this endpoint first when you start report generation. Fill the body of the request with the report columns and any filters or table groupings that you want in the generated report. Use the returned reportId value in other API calls in the workflow.
GET /api/use_case_explorer/{reportId}/status Returns the status of /api/use_case_explorer. Use the endpoint to see whether your report generation completed or failed.
POST /api/use_case_explorer/{reportId}/download_csv Starts the download of a Use Case Explorer report CSV file. Include the reportId value of the /api/use_case_explorer result in the path and fill the body of the request with your selected column codes, sort parameters, rule IDs, or search parameters to get a jobId.
GET /api/use_case_explorer/download_csv/{jobId}/status Checks the status of a Use Case Explorer report CSV file download job. Include the jobId value returned from the /api/use_case_explorer/{reportId}/download_csv endpoint in the path to get a status on whether your job completed or failed.
GET /api/use_case_explorer/download_csv/{jobId}/result Returns the Use Case Explorer report in a CSV file if the /api/use_case_explorer/download_csv/{jobId}/status endpoint returns a 'Completed' status. Include the jobId value that is returned by the /api/use_case_explorer/{reportId}/download_csv endpoint and the name you want for your CSV file in the query to get a download link for your CSV file.

Workflow to generate and download reports in JSON

Generate the Use Case Explorer report as a JSON array in a full report format. This workflow is useful if you want to download the whole result set because the JSON file is faster to download than the JSON body. Pagination is not available in the file download format. The workflow is a 5-step process that uses the API endpoints in the order that is described in the following table:

Endpoint Description
POST /api/use_case_explorer Generates a Use Case Explorer report and returns a reportId. You must use this endpoint first when you start report generation. Fill the body of the request with the report columns and any filters or table groupings that you want in the generated report. Use the returned reportId value in other API endpoints in the workflow.
GET /api/use_case_explorer/{reportId}/status Returns the status of /api/use_case_explorer. Use the endpoint to see whether your report generation succeeded or failed.
POST /api/use_case_explorer/{reportId}/download_json

Downloads the Use Case Explorer report as a JSON file. Include the reportId value of the /api/use_case_explorer endpoint in the path and fill the body with your selected column codes, sort parameters, rule IDs, or search parameters to get a jobId.

GET /api/use_case_explorer/download_json/{jobId}/status

Checks the status of a Use Case Explorer report JSON file download job. Include the jobId value returned from the /api/use_case_explorer/{reportId}/download_json endpoint in the path to get a status on whether your job completed or failed.

GET /api/use_case_explorer/download_json/{jobId}/result

Returns the final result of the Use Case Explorer JSON file after the /api/use_case_explorer/download_json/{jobId}/status endpoint returns a 'Completed' status. Include the jobId value that is returned by the /api/use_case_explorer/{reportId}/download_json endpoint and the name you want for your JSON file in the query to get a download link for your JSON file.

Downloading report data

Procedure

  1. Select a workflow to use.
  2. Click Try it out and then complete the request parameters for the selected workflow. For more information, see Use Case Explorer filters and Report column codes for report APIs.

What to do next

Review the endpoint workflows and try the example script or use the script as a base for your own scripts. Use the filters and report columns that make sense for your environment and needs.