vue-google-api
vue-google-api copied to clipboard
Pulling file list with request method
I'm using version 0.2.0 of the library and attempting to list the files in a specific folder on Google Drive. I used this code:
this.$gapi.request({ path: "https://www.googleapis.com/drive/v3/files", params: { pageSize: 10, fields: "nextPageToken, files(name,id,mimeType)", q: "'" + folderID + "' in parents" }, headers: { authorization: "Bearer " + accessToken } }).then(r => { console.log(r); }).catch(e => { console.error(e); });
This gives me a slew of 404 errors because it doesn't find "https://content.googleapis.com/discovery/v1/apis/h/v1/rest?fields=kind%2Cname%2Cversion%2CrootUrl%2CservicePath%2Cresources%2Cparameters%2Cmethods%2CbatchPath%2Cid&pp=0&key=AIsaSyA8oXJZFVgRh2reHEYO49G1ZGmgqOcOPiQ"
It looks to me like it's doing something with the "discoveryDocs" URL instead of building from the "path" & parameters I set in the request.
Am I doing something wrong to cause that odd behavior?
This is relatively low priority for me because I was able to accomplish what I wanted by making the call with axios, but, of course, I'd rather stick with the v-gapi library if I can. Right now, this problem is the only reason I'm loading axios into the project at all, so if I can avoid it, that would be ideal.