Platforms
Uber

Uber Integration

The Web Action SDK provides powerful actions to interact with Uber. This guide covers all available Uber actions, their inputs, outputs, and usage examples.

Actions

Search for Rides

Search for a list of rides from a pickup location to a dropoff location.

Function: sdk.uber.searchForRides
 
Input:
{
  pickupLocation: string,
  dropoffLocation: string,
}
 
Output:
{
  results: Array<{
    timeToArrival: string,
    arrivalTime: string,
    price: string,
    rideType: string,
    numberOfSeats: number,
  }>
}

Example:

const results = await sdk.uber.searchForRides({
  pickupLocation: "123 Main St, San Francisco, CA 94105",
  dropoffLocation: "456 Market St, San Francisco, CA 94105",
});
 
console.log(results);

Get Ride History

Retrieve the history of rides taken on the connect account.

Function: sdk.uber.getRideHistory;
 
Input: {
}
 
Output: {
  results: Array<{
    pickupLocation: string;
    dropoffLocation: string;
  }>;
}

Example:

const results = await sdk.uber.getRideHistory();
 
console.log(results);

Order Ride

Order a ride from a pickup location to a dropoff location.

Function: sdk.uber.orderRide
 
Input:
{
  pickupLocation: string,
  dropoffLocation: string,
}
 
Output:
{
  message: string,
}

Example:

const result = await sdk.uber.orderRide({
  pickupLocation: "123 Main St, San Francisco, CA 94105",
  dropoffLocation: "456 Market St, San Francisco, CA 94105",
});
 
console.log(result.message);

Troubleshooting

If you encounter any issues while using the Uber integration, please refer to our Troubleshooting guide for common problems and their solutions.