question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getting 403 insufficient permission error on gspread v2 running fine on 0.6.2

See original GitHub issue

using credentials.json from google drive api crendtials

its working without any issue on macbook and when try to amazon linux server it gives insufficent permission error

gspread.v4.exceptions.APIError: {
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "insufficientPermissions",
    "message": "Insufficient Permission"
   }
  ],
  "code": 403,
  "message": "Insufficient Permission"
 }

code to connect to sheet

import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds']
creds = ServiceAccountCredentials.from_json_keyfile_name('google_auth.json', scope)
client = gspread.authorize(creds)

sheet = client.open('MySheetName').sheet1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

96reactions
burnashcommented, Mar 14, 2018

Looks like it’s also related to the scope issue in updated API. As in #512

Try to update the scope to see if it helps:

scope = ['https://spreadsheets.google.com/feeds',
         'https://www.googleapis.com/auth/drive']

as in https://github.com/burnash/gspread/issues/512#issuecomment-372708065

6reactions
xijianlimcommented, Mar 19, 2018

Thanks Burnash, changing the scope to:

scope = [‘https://spreadsheets.google.com/feeds’, ‘https://www.googleapis.com/auth/drive’]

Worked a treat.

Read more comments on GitHub >

github_iconTop Results From Across the Web

getting 403 insufficient permission error on gspread v2 running fine ...
using credentials.json from google drive api crendtials. its working without any issue on macbook and when try to amazon linux server it gives...
Read more >
python - gspread authentication throwing insufficient permission
when moved same config to linux server on aws its giving 403 insufficient permission error. Pip and python version are same. exception gspread....
Read more >
Google Api (Sheets) Api Error Code 403. Insufficient Permission
Open a spreadsheet by title key or url. Read write and format cell ranges. Sharing and access control. Batching updates. getting 403 insufficient...
Read more >
403 insufficient permissions - Google Groups
When I execute the command I get the following error - 403: Insufficient Permission - insuffientpermission. Any ideas on what I have done...
Read more >
403 "access_denied_insufficient_permissions" Errors
If one of these checks returns insufficient permissions, then the error will be returned. This list is not exhaustive. Box has many access ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found