API Usage#
This guide assumes you set up a client and are authenticated to the Ridepooling API. If you haven’t done so, please follow the Basic Client example first.
Offers#
Request offers with the RequestTripOffers
method.
Note
We are currently working on this section. New updates are coming soon.
var metadata = new grpc.Metadata();
metadata.set('customer-id', 'your-customer-id')
const offers = await client.requestTripOffers({
origin: {
location: {
latitude: 53.6344823,
longitude: 10.0555216,
},
primaryAddress: "Stüberedder 14",
secondaryAddress: "22337 Hamburg",
primaryPoiName: "Point A",
secondaryPoiName: "Hamburg, Germany",
},
destination: {
location: {
latitude: 53.6342303,
longitude: 10.0741517,
},
primaryAddress: "Eckerkamp 38",
secondaryAddress: "22391 Hamburg",
primaryPoiName: "Point B",
secondaryPoiName: "Hamburg, Germany",
},
load: [
{
adult: {
wheelchair: Wheelchair.WHEELCHAIR_NOT_NEEDED,
},
child: {
childSeat: ChildSeat.CHILD_SEAT_FORWARDS,
},
},
],
departureTime: Date.now().toString(),
}, metadata);
Order#
Order one Offer with the OrderTrip
method.
Note
We are currently working on this section. New updates are coming soon.
var metadata = new grpc.Metadata();
metadata.set('customer-id', 'your-customer-id')
const orderResponse = await client.orderTrip({offerToken: offers.offers[0].token}, metadata);
console.log(orderResponse) // { tripId: '7bc0118b-748e-4c13-bc5e-bb2164f04927' }
Cancel as Customer#
Cancel a Trip on behalf a Customer with the CancelTripAsCustomer
method.
Note
We are currently working on this section. New updates are coming soon.
var metadata = new grpc.Metadata();
metadata.set('customer-id', 'your-customer-id')
const cancelResponse = await client.cancelTripAsCustomer({tripId: orderResponse.tripId}, metadata);
console.log(cancelResponse) // {} empty response
Cancel as Integrator#
Cancel a Trip as Integrator with the CancelTripAsIntegrator
method.
Note
We are currently working on this section. New updates are coming soon.
const cancelResponse = await client.cancelTripAsIntegrator({tripId: orderResponse.tripId});
console.log(cancelResponse) // {} empty response