[Overview] Overview for the async reporting apis
Offline Reporting APIs help both Rental and Fleet suppliers to manage their reports. They gather data from different places, including linked child organizations to create detailed reports.
The APIs streamline the management of substantial data volumes while maintaining system agility. Additionally, they employ secure links to restrict report access to authorized individuals, ensuring data confidentiality.
¶ Workflow and API Integration
- Step 1: Initiate Report Generation
- Initiate the report generation process using the Generate Report API. This endpoint requires parameters such as
reportType
and the necessary filters, including field, operator, and value. - Upon request, the endpoint returns the report’s metadata, which includes the
reportStatus
andreportId
.
- Initiate the report generation process using the Generate Report API. This endpoint requires parameters such as
- Step 2: Poll Report Status
- Use the
reportId
to track the report’s progress with the Get Report By Report ID API. This endpoint provides the report’s metadata, including its current status. - Continuously poll this endpoint until the report status reaches a terminating condition, either
REPORT_STATUS_COMPLETED
orREPORT_STATUS_ FAILED
.
- Use the
- Step 3: Retrieve the Report
- If the report status is
REPORT_STATUS_COMPLETED
, retrieve the signed URL to download the report using the Create Report URL for the Report API. This endpoint requires the reportId and returns a signed URL that contains the downloadable report content. - Note: The signed URL is valid for only 60 seconds. If expired, generate a new URL using the same reportId.
- If the report status is
- Step 4: Handling Failed Reports
- If the report status is
REPORT_STATUS_FAILED
, consult thefailedReason
provided in the response of the Get Report By Report ID API for details on why the report generation failed.
- If the report status is
Additional Functionality:
- To retrieve a list of all reports generated within the organization, use the List All Reports for the Organization API to view reports in a paginated format. The reports are available in CSV format, facilitating easy accessibility and analysis.
¶ Platform Offerings
The platform features 4 endpoints tailored for asynchronous reporting workflows:
- Generate Report API : Utilize this API to create detailed reports for rental or fleet suppliers, accommodating large datasets and hierarchical organizational structures.
- Get Report By Report ID API : Employed to access detailed information about specific reports, enhancing system visibility.
- List all reports for the organization API : Generates a secure, time-limited URL for accessing reports.
- Create Report URL for the report API : Provides a comprehensive, paginated list of all reports associated with an organization.
¶ FAQs
-
How can we speed up the report generation process for subsidiary organizations?
- In the current scenario, the rate-limiting logic is as follows:
- Generate Report API
- A maximum of 6 reports can be in progress at any given time per requested Organization UUID.
- ClientID level rate limiting allows for 600 requests every 10 minutes.
- Get Report API
- ClientID level rate limiting is set at 600 requests every 10 minutes.
- Download Report API
- ClientID level rate limiting is also 600 requests every 10 minutes.
- Generate Report API
Assuming there are 20 child organizations, and each organization needs 6 reports, this totals 120 reports. Below is an optimized method to generate all child reports in parallel without exceeding the rate limit:
- Collect all 20 child organization UUIDs.
- Simultaneously trigger the Generate Report API for all 20 child organizations and for 6 reports each (i.e., 120 API calls in total), staying within the rate limits.
- Collect all 120 report IDs from the responses.
- Wait approximately 2–5 minutes, then start polling the report IDs using the Get Report API endpoint. Poll the Get Reports endpoint at a frequency of once per minute to prevent exceeding the rate limit.
- For reports that have a status of “Completed,” trigger the Download Report API to retrieve the CSV files.
Using the above process, it typically takes about 5–10 minutes to obtain all 120 reports for all child organizations.
- In the current scenario, the rate-limiting logic is as follows: