1
我該如何讓gspread使用我的oauth憑證?我具有HTTP響應gspread.httpsession.HTTPError錯誤:( 誰能告訴我什麼是錯我的代碼?python gspread授權oauth2憑證
import datetime
import gspread
import json
import MySQLdb
from oauth2client.client import OAuth2Credentials
# Get access token from database
data = json.loads(row['access_token'])
credentials = OAuth2Credentials(
data['access_token'],
"1*************************k.apps.googleusercontent.com",
"9t*****************W",
data['refresh_token'],
datetime.datetime.now(),
"https://accounts.google.com/o/oauth2/token",
'user-agent'
)
gc = gspread.authorize(credentials)
wks = gc.open_by_key('1*****************W')
當行包含從數據庫中的數據(它由谷歌返回的OAuth訪問令牌)?M( _ _)M