1
votes

I am working on integrating Uber api's. I am not able to make ride request using access token, it say 'Invalid OAuth 2.0 credentials provided'

I am able to get profile and history information but whenever I make ride request I get a response 'Unauthorized'

In uber developer account I am not able to enable request scope and this could be the reason for above mentioned error.

is this the issue with uber developer console and if not what could be the reason and how to resolve it.

Screen shot Image

thank you...

2

2 Answers

1
votes
  • Are you using the Production or the Sandbox Uber API to send the ride request?

    Uber API sandbox URL = https://api.uber.com/v1
    Uber API production URL = https://sandbox-api.uber.com/v1

    For production you need to send your request for review inside Uber Developers Dashboard by pressing the "REQUEST FULL ACCESS" button besides the "request" scope in the Authorizations tab.

  • If you are using the Sandbox API and you get 401 unauthorized HTTP response status code, then this means that the Bearer token you are sending to the POST /v1/requests endpoint has not been granted the "request" scope.
    • Make sure that the access token has been granted the "request" scope, in the step 1 of the OAuth2 authentication flow
    • Make sure that you are sending a Bearer token and not the server token for the ride request.
      (The ride request should contain the "Authorization: Bearer token_here" header, NOT "Authorization: Token token_here")
    • Make sure that the Bearer token is still valid (hasn't expired, or hasn't been invalidated by another login of the same Uber user)
    • Make sure that you are sending the mandatory parameters: i.e. start_latitude/start_longitude or start_place_id with your request

Also see this answer

0
votes

The request scope is whitelist only which means you need to submit your app for review by our team before we issue that scope to your application. With that said, if you attempt to go through the OAuth flow for your application using the Uber account associated with the application in the developer platform you'll be able to request the "request" scope.

Best, Richie