I am making a request to https://sandbox-api.uber.com/v1/requests using the Bearer token for my account (which is the admin of the Uber app).
When I make the request I get a 401:
{
"message": "Missing scope: request",
"code": "unauthorized"
}
As I've said, the access_token I have is for the email address that is registered as the app admin so this request should work right?
Yes when you call https://login.uber.com/oauth/authorize
you should request "&scope=profile%20history_lite%20history%20request"
If you try this repo on Github which is a thin wrapper for Uber APIs, you can make requests easily.
Or you can do the scope thing yourself if you have the OAuth2 framework, what you can do is pass in the necessary scope strings into below API:
[[NXOAuth2AccountStore sharedStore] setClientID:_clientID
secret:_clientSecret
scope:[NSSet setWithObjects:@"request", @"history_lite", @"profile", @"request_receipt", nil]
authorizationURL:[NSURL URLWithString:@"https://login.uber.com/oauth/authorize"]
tokenURL:[NSURL URLWithString:@"https://login.uber.com/oauth/token"]
redirectURL:[NSURL URLWithString:_redirectURL]
keyChainGroup:nil
forAccountType:_applicationName];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With