in example/driver_dashboard.py [0:0]
def connect():
"""Connect controller to handle token exchange and query Uber API."""
# Exchange authorization code for acceess token and create session
session = auth_flow.get_session(request.url)
client = UberRidesClient(session)
# Fetch profile for driver
profile = client.get_driver_profile().json
# Fetch last 50 trips and payments for driver
trips = client.get_driver_trips(0, 50).json
payments = client.get_driver_payments(0, 50).json
return render_template('driver_dashboard.html',
profile=profile,
trips=trips['trips'],
payments=payments['payments']
)