Three lines

Uber

Developers

[API] Supplier Performance Data

Privileged and Confidential This endpoint design has been confidentially shared with you. It is still under development and is subject to change without notice. Please do not share this document or API endpoint details with anyone who is not authorized to have access. For more information read about scopes.

Get the performance data (metrics) of drivers or vehicles (dimensions) given the supplier ID and a given time range.

Resource

/v1/vehicle-suppliers/analytics-data/query

HTTP Method

POST

Access Method

Client Credentials

Required scopes

solutions.suppliers.metrics.read

Usage

The client should access the Get Organizations API that fetches the child organizations for the given organisation. This API returns the encrypted IDs for the linked organizations . The clients can then use the encrypted organization ID in the below request for the performance API to fetch the performance data response.

Support for Hierarchical Data

Not Supported. The API returns the performance data of the drivers/vehicles directly linked to the organization ID passed in the query param as shown in Example Request. It doesn’t support fetching drivers linked to their child organizations

Example Request (driver)
curl -i -X POST "https://api.uber.com/v1/vehicle-suppliers/analytics-data/query" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
  "reportRequests": [
    {
      "timeRanges": [
        {
          "startsAt": 1674129878020,
          "endsAt": 1674334678020
        }
      ],
      "dimensions": [
        {
          "name": "vs:driver"
        }
      ],
      "metrics": [
        {
          "expression": "vs:HoursOnline"
        },
        {
          "expression": "vs:HoursOnTrip"
        },
        {
          "expression": "vs:TotalTrips"
        }
      ],
      "dimension_filter_clauses":[
            {
               "operator":"FILTER_LOGICAL_OPERATOR_AND",
               "filters":[
                  {
                     "dimension_name":"vs:driver",
                     "operator":"OPERATOR_IN",
                     "expressions":[
                        "<driver_uuid1>",
                        "<driver_uuid2>"
                     ]
                  }
               ]
            }
         ],
        "pagination_options": {
        "pageSize": 7,
        "pageToken": "<next_page_token_provided_on_the_response>",
      }
    }
  ],
  "orgId": {
    "orgUuid": "<encrypted_supplier_uuid>"
  }
}'

Example Request (vehicle)

curl -i -X POST "https://api.uber.com/v1/vehicle-suppliers/analytics-data/query" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
  "reportRequests": [
    {
      "timeRanges": [
        {
          "startsAt": 1674129878020,
          "endsAt": 1674334678020
        }
      ],
      "dimensions": [
        {
          "name": "vs:vehicle"
        }
      ],
      "metrics": [
        {
          "expression": "vs:HoursOnline"
        },
        {
          "expression": "vs:HoursOnTrip"
        },
        {
          "expression": "vs:TotalTrips"
        },
        {
          "expression": "vs:TotalEarnings"
        }
      ],
      "dimension_filter_clauses":[
            {
               "operator":"FILTER_LOGICAL_OPERATOR_AND",
               "filters":[
                  {
                     "dimension_name":"vs:vehicle",
                     "operator":"OPERATOR_IN",
                     "expressions":[
                        "<vehicle_uuid1>",
                        "<vehicle_uuid2>"
                    ]
                  }
               ]
            }
         ],
        "pagination_options": {
        "pageSize": 8,
        "pageToken": "<next_page_token_provided_on_the_response>",
      }
    }
  ],
  "orgId": {
    "orgUuid": "<encrypted_supplier_uuid>"
  }
}'

Request Body Fields
Name Type Description
reportRequests object array List of ReportRequest objects
orgId object Object of type OrgUuid

OrgUuid

Name Type Description
OrgUuid UUID String encrypted supplier UUID

ReportRequest

Name Type Description
timeRanges object array List of Interval objects.
Only one (1) Interval object is allowed per request
dimensions object array List of Dimension objects
metrics object array List of Metric objects
dimensions_filter_clauses (Optional) object array List of DimensionFilterClause objects to be used for fetching data for list of drivers or vehicles
pagination_options (Optional) object Object of type PaginationOptions

Interval

Name Type Description
startsAt int UNIX milliseconds timestamp
endsAt int UNIX milliseconds timestamp

Dimension

Name Type Description
name string "vs:driver" or "vs:vehicle"

Metric

Name Type Description
expression string For driver
"vs:HoursOnline": Total number of hours the driver was available on the platform for making trips. Minute precision.
"vs:HoursOnTrip": Total number of hours a driver was between the statuses driver pick up rider and driver drop off rider. Minute precision.
"vs:TotalTrips": Total number of trips a driver served on the platform.

For vehicle
"vs:HoursOnline": Total number of hours the vehicle was available on the platform for making trips. Minute precision.
"vs:HoursOnTrip": Total number of hours a vehicle was between the statuses vehicle pick up rider and vehicle drop off rider. Minute precision
"vs:TotalTrips": Total number of trips a vehicle served on the platform.
"vs:TotalEarnings": Total amount of earnings the vehicle generated on the time interval requested.

DimensionFilterClause

Name Type Description
operator (Optional) object FilterLogicalOperator object
filters (Optional) object array List of DimensionFilter

FilterLogicalOperator

Name Type Description
FILTER_LOGICAL_OPERATOR_AND FILTER_LOGICAL_OPERATOR_AND Operator to be used for AND filters
FILTER_LOGICAL_OPERATOR_OR FILTER_LOGICAL_OPERATOR_OR Operator to be used for OR filters

DimensionFilter

Name Type Description
dimension_name (Optional) string "vs:driver" or "vs:vehicle"
operator (Optional) object Operator object
expressions (Optional) string array List of un-encrypted driver or vehicle uuids

Operator

Name Type Description
OPERATOR_IN OPERATOR_IN Operator to be used for checking value in array

PaginationOptions

Name Type Description
pageToken (Optional) string Page token for the next entities that should come on the report
pageSize (Optional) int32 Number of entities that come on each report. Max is 100 per request

Response Body Fields
Name Type Description
reports object array List of Report objects

Report

Name Type Description
columnHeader object ColumnHeader object
data object ReportData object
paginationResult (Optional) object PaginationResult object

ColumnHeader

Name Type Description
dimensionHeaderEntries (Optional) object array List of DimensionHeaderEntry objects
metricHeaderEntries (Optional) object array MetricHeaderEntry object

DimensionHeaderEntry

Name Type Description
name string For driver : "FirstName", "LastName", "PhoneNumber", "Email"
For vehicle : "PlateNumber", "VIN"
type string Corresponds to the type that can safely be casted from the string returned.
Options are: "DIMENSION_TYPE_INVALID", "DIMENSION_TYPE_STRING", "DIMENSION_TYPE_INT64"

MetricHeaderEntry

Name Type Description
name string For driver : "HoursOnline", "HoursOnTrip", "TotalTrips"
For vehicle : "HoursOnline", "HoursOnTrip", "TotalTrips", "TotalEarnings"
type string Corresponds to the type that can safely be casted from the string returned.
Options are: "METRIC_TYPE_INVALID", "METRIC_TYPE_INT32",
"METRIC_TYPE_INT64", "METRIC_TYPE_DOUBLE", "METRIC_TYPE_STRING"

ReportData

Name Type Description
timeRangeData (Optional) object array List of TimeRangeData objects

TimeRangeData

Name Type Description
rows object array List of ReportRow objects

ReportRow

Name Type Description
dimensionName string String tag identifier of the dimensionId for the corresponding row (entity data)
Options are: UUID.
dimensionId string String ID, corresponding to the dimensionName specified. (raw UUID)
dimensionValues object array List of ordered string objects, corresponding to the dimensionHeaderEntries order
metricValues object array List of ordered string objects, corresponding to the metricHeaderEntries order

PaginationResult

Name Type Description
nextPageToken string String token to be used to retrieve the next entities that should come on an specific report. If no more entities to return, PaginationResult object will be empty

Example Response (For vehicle)
"statusCode": 200,
"body": {
  "reports": [
    {
      "columnHeader": {
        "dimensionHeaderEntries": [
          {
            "name": "PlateNumber",
            "type": "DIMENSION_TYPE_STRING"
          },
          {
            "name": "VIN",
            "type": "DIMENSION_TYPE_STRING"
          }
        ],
        "metricHeaderEntries": [
          {
            "name": "HoursOnline",
            "type": "METRIC_TYPE_DOUBLE"
          },
          {
            "name": "HoursOnTrip",
            "type": "METRIC_TYPE_DOUBLE"
          },
          {
            "name": "TotalTrips",
            "type": "METRIC_TYPE_INT64"
          }
          {
            "name": "TotalEarnings",
            "type": "METRIC_TYPE_DOUBLE"
          },
        ]
      },
      "data": {
        "timeRangeData": [
          {
            "rows": [
              {
                "dimensionName": "UUID",
                "dimensionId": "<vehicle_uuid>",
                "dimensionValues": [
                  "MH01DR8692",
                  "4Y1SL65848Z411438"
                ],
                "metricValues": [
                  "10.860493",
                  "3.066504",
                  "5"
                  "100.123678",
                ]
              }
            ]
          }
        ]
      },
      "paginationResult": {}
    }
  ]
}
Example Response (For driver)
"statusCode": 200,
"body": {
  "reports": [
    {
      "columnHeader": {
        "dimensionHeaderEntries": [
          {
            "name": "FirstName",
            "type": "DIMENSION_TYPE_STRING"
          },
          {
            "name": "LastName",
            "type": "DIMENSION_TYPE_STRING"
          },
          {
            "name": "PhoneNumber",
            "type": "DIMENSION_TYPE_STRING"
          },
          {
            "name": "Email",
            "type": "DIMENSION_TYPE_STRING"
          }
        ],
        "metricHeaderEntries": [
          {
            "name": "HoursOnline",
            "type": "METRIC_TYPE_DOUBLE"
          },
          {
            "name": "HoursOnTrip",
            "type": "METRIC_TYPE_DOUBLE"
          },
          {
            "name": "TotalTrips",
            "type": "METRIC_TYPE_INT64"
          }
        ]
      },
      "data": {
        "timeRangeData": [
          {
            "rows": [
              {
                "dimensionName": "UUID",
                "dimensionId": "<driver_uuid>",
                "dimensionValues": [
                  "Some Driver Name",
                  "Some Driver Last Name",
                  "123456789",
                  "email@email.com"
                ],
                "metricValues": [
                  "28.683780",
                  "18.382747",
                  "25"
                ]
              }
            ]
          }
        ]
      },
      "paginationResult": {
        "nextPageToken": "8LXQdrVZDtraWLeNz6_tqiRPXV2rAMvy_RyJXh3kfQc62bKM0JT-Zk4C6xj9mC1SXYc32jvCB1QTs2j20Jf3hw71_TwAsZXULdQ5gtWNSK2jWp89_DWGJTQI14×CvUyQZQ=="
      }
    }
  ]
}

** Each row is an entity (driver or vehicle) with its given dimensions and metrics.

** An (Optional) param is one that you can omit (if part of the request), or one that can be empty (if part of the response).


Pagination
  • If pageSize is not specified, the endpoint has a default return value of 100 records (pageSize) per report.

  • If the returned paginationResult object is empty ({}), it means there are no more entities to report.

  • If the returned paginationResult object is not empty, it means you can keep calling the endpoint to get the missing entities on the next subsequent requested reports, by passing the provided nextPageToken and a valid pageSize (between 1 and 1000).

  • The endpoint has an enforced pageSize limit of 1000 max entities (driver or vehicle information records) per report. If you ask for more, or pass a negative pageSize value, an error will be returned.

  • The time range provided in the request has to be more than or equal to 1 hr.

  • The api response considers the exact epoch time (UTC timezone) mentioned in request for fetching the requested data.

Rate Limit
  • Rate limit for this endpoint is 100 000 rph (requests per hour) per Developer Application.
Endpoint Specific Errors
Http Status Code Code Message
400 bad_request The request parameters are invalid.
500 internal_server_error Internal server error.
403 unauthenticated User does not have permission.
429 rate_limited Number of requests exceeds allowed limit.
503 service_unavailable Service unavailable.
401 unauthorized Invalid OAuth 2.0 credentials.

Uber

Developers
© 2023 Uber Technologies Inc.