autoGoogleAPI icon indicating copy to clipboard operation
autoGoogleAPI copied to clipboard

(Automatic) Scope definition

Open flovv opened this issue 9 years ago • 1 comments

Hi Mark,

just a quick question. I tried to work with the qpxExpress API.

What I struggle with was defining the right scope. I used options("googleAuthR.scopes.selected" = c("https://www.googleapis.com/auth/qpxExpress")) but that resulted in a Google error page.

Also I looked up the gar_discovery_apis_list() function, but that does not return the scope of an API (which would be nice to have).

What is the best way to look up the "scope"? What am I missing here?

Thanks, Florian

flovv avatar Sep 23 '16 08:09 flovv

Hi Florian,

The scopes should be in the readme, but looking at the https://github.com/MarkEdmondson1234/autoGoogleAPI/tree/master/googleqpxExpressv1.auto in particular I don't see one added. Hmm.

For comparison, the Google Books has its listed: https://github.com/MarkEdmondson1234/autoGoogleAPI/tree/master/googlebooksv1.auto

You can look at the Discovery API result yourself by using

api_meta <- googleAuthR::gar_discovery_api("qpxExpress", "v1") 

I use listviewer::jsonedit(api_meta) to examine the response.

In this case the auth field is empty. Bad Google :D Or at least, its not supplied anywhere in the documentation either, perhaps because its public data? We'd have to move to asking their support on why scopes aren't included.

I hadn't thought this would be a case so I'm not sure the googleAuthR calls will work without a scope, but let me know. Perhaps you can just fill in a placeholder.

The API explorer is a good place to check, it specifies no scopes needed when I just had a look: https://developers.google.com/apis-explorer/#p/qpxExpress/v1/qpxExpress.trips.search

screen shot 2016-09-23 at 10 39 29

MarkEdmondson1234 avatar Sep 23 '16 08:09 MarkEdmondson1234