2

We are using the Google drive API to allow our users to browse and select a file to use in a report. One of our users (the issue is not widespread) is getting an error(below) when attempting to get a list of files.

JSON body returned from Google:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "forbidden",
    "message": "Forbidden"
   }
  ],
  "code": 403,
  "message": "Forbidden"
 }
}

Which is a bit confusing as it is not one of the listed errors here: https://developers.google.com/drive/web/handle-errors

Does anyone have any ideas on what might be causing this? Thanks for any insight!

Luke Chamberlain
  • 430
  • 2
  • 5
  • 17
  • 1
    403 is a standard http error which is probably why it's not listed. Need more info, esp which OAuth scope you are using, and confirmation that (a) the file exists and (b) that the **application** has been granted access to the file in question. – pinoyyid May 07 '14 at 15:03
  • Sorry updated the question, the error is returned from Google when we try to get a list of files for that user. OAuth scopes are correct(Many other users cans can browse and retrieve files correctly). The reason the error is confusing is the link has several different 403 errors with helpful reason and message fields, but for some reason we are getting a generic one. – Luke Chamberlain May 07 '14 at 15:10
  • Might be worth pasting the http request to see if we can spot anything there – pinoyyid May 07 '14 at 16:19

2 Answers2

4

It turned out to be related to this question: Getting a 403 - Forbidden for Google Service Account

This user's company did not have Google Drive as one of their activated apps.

Community
  • 1
  • 1
Luke Chamberlain
  • 430
  • 2
  • 5
  • 17
4

This error also occurs if you disable the Google Drive setting called "Allow users to install Google Drive apps". This might be a good thing to check if you are certain that Google Drive is already enabled.

enter image description here

popstr
  • 1,000
  • 9
  • 17