0

Using this code:

import gspread
from oauth2client.service_account import ServiceAccountCredentials

scope = ['https://www.googleapis.com/auth/spreadsheets',
        'https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name('Consumer 
Outr.json', scope)
gc = gspread.authorize(credentials)
nonStartFreeTrial = gc.open("Consumer Outreach")[0]

I need to use the service credentials API from google instead of the regular API keys, and I keep getting:

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

I'm writing this code in ipynb, and ideally will be able to access the spreadsheet from a live cell. I've read that this can be fixed using an API key, but gspread documentation suggests Service Account Credentials are the best method. Genuinely have no idea what to fix (new to google APIs!).

0 Answers0