Search code examples
pythonuber-api

UBER Python API returns uber_rides.errors.ClientError


I wrote a piece of code to get product information. I used the code provided in their github.

from uber_rides.session import Session
session = Session(server_token="key_given_here")

from uber_rides.client import UberRidesClient
client = UberRidesClient(session)
response = client.get_products(12.9242845,77.582953)
products = response.json.get('products')
print products

It returns the following error:

uber_rides.errors.ClientError: The request contains bad syntax or cannot be filled due to a fault from the client sending the request.

Why this happening. What is wrong with my code ?


Solution

  • I got the answer. The code is working perfect. One character was missing in the server_token I provided.