Skip to content

Drive API Quickstart broken #69

@DustinWehr

Description

@DustinWehr

The file https://github.com/gsuitedevs/browser-samples/blob/master/drive/quickstart/index.html, which is currently hosted at https://developers.google.com/drive/api/v3/quickstart/js.
Following the instructions exactly:

  • Authorize with my google account works.
  • The call to listFiles gives 401 error. Likewise if I try to call it from the console.

But it works if I remove the apiKey parameter from the gapi.client.init call.

Didn't know if I should make an issue here or at https://github.com/google/google-api-javascript-client.

JavaScript Console Output

cb=gapi.loaded_0:228 GET https://content.googleapis.com/drive/v3/files?pageSize=10&fields=nextPageToken%2C%20files(id%2C%20name)&key=[MY API KEY DELETED] 401
wh @ cb=gapi.loaded_0:228
g @ cb=gapi.loaded_0:228
xh @ cb=gapi.loaded_0:229
(anonymous) @ cb=gapi.loaded_0:229
d @ cb=gapi.loaded_0:186
b @ cb=gapi.loaded_0:181
cb=gapi.loaded_0:191 Uncaught {result: {…}, body: "{↵ "error": {↵  "errors": [↵   {↵    "domain": "gl…e": 401,↵  "message": "Invalid Credentials"↵ }↵}↵", headers: {…}, status: 401, statusText: null}
(anonymous) @ cb=gapi.loaded_0:191
setTimeout (async)
Aj @ cb=gapi.loaded_0:191
(anonymous) @ cb=gapi.loaded_0:204
Nj @ cb=gapi.loaded_0:196
Promise.then (async)
Ij @ cb=gapi.loaded_0:196
_.Mj @ cb=gapi.loaded_0:196
ek @ cb=gapi.loaded_0:203
_.Oj.kh @ cb=gapi.loaded_0:202
(anonymous) @ cb=gapi.loaded_0:197
d @ cb=gapi.loaded_0:976
(anonymous) @ cb=gapi.loaded_0:974
(anonymous) @ cb=gapi.loaded_0:491
v.__cb @ cb=gapi.loaded_0:431
d @ cb=gapi.loaded_0:425
b @ cb=gapi.loaded_0:420

Specifications

  • Browser (Chrome/Internet Explorer/Firefox): Chrome
  • OS (Mac/Linux/Windows): Linux

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions