Showing invalid_scope when adding profile or request

62 views Asked by At

I am trying to access Uber API for requesting rides and I am trying to access appropriate scope like

  • profile

  • request_rides

  • request

And I successfully got the token, clientid, clientsecret, access_token and Then I tried to access profile by calling

from uber_rides.auth import AuthorizationCodeGrant 

auth_flow = AuthorizationCodeGrant(
    <CLIENT_ID>,
    <SCOPES>,
    <CLIENT_SECRET>,
    <REDIRECT_URI>
)
auth_url = auth_flow.get_authorization_url()

session = auth_flow.get_session(redirect_url)
client = UberRidesClient(session, sandbox_mode=True)
credentials = session.oauth2credential

Above commands didn't raise any errors but when I execute

response = client.get_user_profile()

then I showed

uber_rides.errors.ClientError: 401: This endpoint requires at least one of the following scopes: profile, eats.pos_provisioning, profile.internal_uuid

And When I append profile in below <SCOPES> in browser then It showed invalid_scope . I have no idea why it is showing this error every time I call the url to get the session.

In https://login.uber.com/oauth/v2/token?clientid= POST request, it is showing only "scope": "offline_access" in scope.

So How can I get the access of profile and request_rides scope ?

Any help would be much Appreciated.

0

There are 0 answers