[Overview] Overview for the async reporting apis
This document provides an overview on how to use the different apis in order to send a request to generate report.
¶ User Flow
In order to generate the report and get the report there are 3 steps to be followed.
- Send a request to initiate the generate report.
- Poll for the status of the report request in above step.
- Once the status of report is
REPORT_STATUS_COMPLETED
then trigger a request to get a signed url for the report that was generated.
In addition to above if there is a need to list all the reports generated in the organization then List all reports for the organization API
will provide that information in a paginated manner.
The generated file will be of csv format.
¶ APIs to be used
- For sending the request to generate report use
Generate Report API
.- This endpoint takes reportType and other filter types needed for generating the report.
- The response of the endpoint will return the report’s metadata information with report status and reportId.
- Use the reportId for further subsequent API calls(mentioned in step 2 & 3).
- Poll the status of the report using Get Report By
Report ID API
.- This endpoint takes reportId as input and returns the report metadata having report status.
- Use this endpoint for fetching the report status and once the report status is a terminating status (ie
REPORT_STATUS_COMPLETED
orREPORT_STATUS_FAILED
) move to step 3.
- If the report status is
REPORT_STATUS_COMPLETED
then use theCreate Report URL for the report API
to get the signed url for the generated report.- This endpoint takes the reportId as input and returns the signed url.
- Open this signed url and it will contain the downloadable content for the requested report.
- This signed url will be valid only for 60sec. Post which we need to generate the url again for the same reportId.
- If the report status is
REPORT_STATUS_FAILED
then check the fieldfailedReason
present in the repose ofGet Report By Report ID API
for more information.
¶ Available APIs
Currently there are 4 endpoints which are exposed for supporting the async reporting workflow. Below are the mentioned 4 apis
- Generate Report API
- Get Report By Report ID API
- List all reports for the organization API
- Create Report URL for the report API
¶ Optimal way to use async reporting APIs for generating reports for multiple organisation
- As mentioned in notes and rate limit section of [Generate Report API] (https://developer.uber.com/docs/vehicles/references/api/v1/vehicle-suppliers/suppliers/generate-report#notes), there are 2 limitations applied
- 600 requests in 10 minutes per developer application ID.
- 6 reports in 3 hour time range can be in progress status per organization uuid. (irrespective of reportType)
- Considering the aforementioned limitations, generation of multiple reports can be triggered in parallel without waiting for each one to get completed.
¶ Notes
- The generated report file will contain data for all the child organizations present under the organization uuid passed in the request of
Generate Report API
.