Gain A Competitive Edge With Uber's Driver API
Written by Nikos Vaggalis   
Tuesday, 08 November 2016

A new sort of API, invokable by 3rd party consumers and carrying brand new functionality, finds its way to Uber's repository's already rich collection of APIs and Uber is offering developers beta access.


uberdriver

 

Until now Uber's repository has contained the purely client-centric APIs of the Ride Requests, Trip Experiences and UberRUSH Deliveries (an API for logistics and on demand delivery that lets customers track the location of their delivery from any device). The new Driver API is different in that it doesn't attempt to enhance a passenger's ride but instead looks at things from a driver's perspective and comprises a set of well defined REST endpoints:

GET /partners/me

Accessing this endpoint returns the profile of an authenticated driver, complete with name, email, ratings, trip count and activation status.

One potential use of this endpoint is that by presenting the driver's personal details, Uber re-assures the rider of a trustworthy ride. It is crucially concerned with driver reputation, providing statistics such as the driver's  ratings and trip count. By going public with such details Uber preferentially rewards a driver over other lower ranked colleagues.    

The endpoint is accessible through a GET request (and an OAuth 2.0 token as a header) to https://api.uber.com/v1/partners/me

A typical response from the service is a JSON object filled with the driver's details:


{ "driver_id": "3ag923b1-ff5d-4422-80da-a5cefdca3cea", "first_name": "John", "last_name": "Driver", "phone_number": "+12345678901", "email": "john@example.com", "picture":"https:\/\/subdomain.cloudfront.net\/default.jpeg", "rating": 4.9, "promo_code": "join_john_on_uber", "activation_status": "active" }

 

GET /partners/payments

An endpoint that supplies a 10-day flashback of data on the driver's earnings. It's offered as a service for the driver's internal consumption and can be used to keep the driver's transactions under close monitoring and generate payment reports such as  breakdowns of  income or expected taxes, thus aiding the driver in keeping track of the  job's financial aspects.

It is again accessible through a GET request to https://api.uber.com/v1/partners/payments

Typical response is a JSON array whose elements are indexes of unique transactions information:


{ "offset": 0, "limit": 2, "count": 123, "payments": [ { "category": "fare", "breakdown": { "other": 6.83, "toll": 2, "service_fee": -1.20 }, "rider_fees": { "split_fare": 0.50 }, "event_time": 1465224550, "trip_id": "c72787af", "cash_collected": 7.63, "amount": 7.63, "driver_id": "8LaCLRbV", "partner_id": "8LaCLRbV", "currency_code": "USD" }, { "category": "device_payment", "breakdown": { "other": 0 }, "event_time": 1465646574, "trip_id": null, "cash_collected": 0, "amount": -5, "driver_id": "8LaCLRbV", "rider_fees": {}, "partner_id": "8LaCLRbV", "currency_code": "USD" } ] }

 

GET /partners/trips

This endpoint is by far the most interesting, and potentially profitable from a driver's perspective. It is typically to be used by third party driver's partners, concerned with capitalizing on each trip's attached meta-data, so that they can offer services, discounts or loyalty programs to their drivers. Existing examples in Sears offering 50% off oil changes and 30% back in points on all labor at Sears Auto Centers, or in Sherpashare's processing the trip data for generating optimal routes in order to help driver-partners get additional ride requests.

The endpoint is accessible in a similar fashion through
https://api.uber.com/v1/partners/trips
while the expected response is a JSON object that contains an array whose elements are indexes to unique trips:


{ "count": 1, "limit": 10, "offset": 0, "trips": [{ "dropoff": { "timestamp": 1455912051 }, "vehicle_id": "e6d1e6e8-fb19-49b5-b0a9-690672dab458", "distance": 0, "start_city": { "latitude": 37.7749, "display_name": "San Francisco", "longitude": -122.4194 }, "status_changes": [{ "status": "accepted", "timestamp": 1455910811 }, { "status": "driver_arrived", "timestamp": 1455910831 }, { "status": "trip_began", "timestamp": 1455910832 }, { "status": "completed", "timestamp": 1455912051 }], "pickup": { "timestamp": 1455910832 }, "driver_id": "8GhJMmFh8fxRCsIlzf8kY12cJx97
           COSXldXaCHRLfha_7UM8jyR3SVJyGSaV-
           eFlXpf2Fa6rAo15bQ_gkHq-5lS5D9CaCmHRT
           jycmUxiaC0ee1iTlJ1v7R5GydCONS46IA==",
        "status": "completed",
        "duration": 1220,
        "trip_id": "e33f756b-16e9-4cb4-96d4-ef0d0e5c9838"
    }]
}

As such, the Driver API takes Uber one more step further down the road of its attempts to provide a centralized and integrated platform in the ever competitive ride sharing business, luring even more clients, riders, drivers and developers under one roof.

The only hindrance to the Driver's API widespread adoption is, that, as it currently stands, the API is offered as a limited beta with interested parties having to fill an application in order to be granted access.

uberlogo

More Information

Uber Developers

Introducing the Driver API

Driver API documentation

Related Articles

Udacity's Self-Driving Car Engineer Nanodegree

Self Driving Vehicles Go Public 

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter,subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin

 

Banner


Huawei's Ark Compiler Is A Publicity Stunt?
19/09/2019

The Huawei saga seems to grow ever more unreal as it unfolds. Its main strategy to get programmers working with its new OS Harmony is a compiler, Ark,  that takes Android apps and compiles them,  [ ... ]



TensorFlow 2 Offers Faster Model Training
02/10/2019

There's a new version of Google TensorFlow with faster model training and a move to Keras as the central high-level API used to build and train models.


More News

 

graphics

 



 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 08 November 2016 )