私はpythonでgoogle calendar apiを使用しています。 私はサービスアカウントを作成しており、プライベートキーを使用して自分のサーバーからカレンダーAPIに接続しています。GoogleカレンダーAPIの通話制限から4XXエラーを取得する
すべてうまくいきました。
昨日、私はエラーを取得開始しました:
私はコンソールにログイン{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
}
私の限界は、次のとおりです。
デイリークォータは真夜中太平洋標準時(PT)にリセット。
クエリ1,000,000
要求/ 100seconds /ユーザーの
要求/日114 500
コンソールが正しく、私は4XXエラーを打っていますことを私に示しており、各ヒットは、エラーカウントをインクリメントし、私はないですこの問題を解決する方法を確認してください
誰かが私がどこから探し始めることができますか?
私のコードの下には、私はそれが
昇給を破るこの段階で
with open(os.path.dirname(os.path.abspath(__file__)) + "/KeyName.p12") as f:
private_key = f.read()
credentials = SignedJwtAssertionCredentials(client_email, private_key,
scope=['https://www.googleapis.com/auth/calendar', 'https://www.googleapis.com/auth/calendar.readonly'])
http = Http()
credentials.authorize(http)
service = build(serviceName='calendar', version='v3', http=http)
today_beginning = datetime.combine(date.today(), time())
today_end = today_beginning + timedelta(1, 0) - timedelta(0, 1)
now = datetime.now().isoformat()
timeMin = today_beginning.isoformat() + 'Z'
timeMax = today_end.isoformat() + 'Z'
# events
events = service.events().list(calendarId=calendar_id, timeMin=timeMin, timeMax=timeMax).execute()
を接続するために使用HttpError(それぞれ、コンテンツ、URI = self.uri) googleapiclient.errors.HttpErrorます。https: //www.googleapis.com/calendar/v3/calendars/.../hidden/parts/ ..返された「見つかりません」>
以下は過去30日間の私のリクエストを示す画像です。ドロップする場所と4xxを参照してください
UPDATE:私は、次の
scopes = ['https://www.googleapis.com/auth/calendar.readonly']
# p12 keyfile
# keyfile = os.path.dirname(os.path.abspath(__file__)) + "/" + p12_key
# credentials = ServiceAccountCredentials.from_p12_keyfile(client_email, keyfile, 'notasecret', scopes)
# json keyfile
keyfile = os.path.dirname(os.path.abspath(__file__)) + "/" + json_key
credentials = ServiceAccountCredentials.from_json_keyfile_name(keyfile, scopes)
http_auth = credentials.authorize(Http())
service = build(serviceName='calendar', version='v3', http=http_auth)
today_beginning = datetime.combine(date.today(), time())
today_end = today_beginning + timedelta(1, 0) - timedelta(0, 1)
now = datetime.now().isoformat()
timeMin = today_beginning.isoformat() + 'Z'
timeMax = today_end.isoformat() + 'Z'
# events
events = service.events().list(calendarId=calendar_id, timeMin=timeMin, timeMax=timeMax).execute()
このコードでは、ドキュメントの最新の変更を反映するコードを変更し
限られた成功を収めていくつかの変更を行った
json &とp12 certを使用して認証しようとしました
エラーは引き続き発生します。 新しい資格情報、json + p12で別のサービスアカウントを作成しましたが、エラーは引き続き発生します。 新しいカレンダーを作成しましたが、エラーは解決されませんでした。
私は持っている別のGoogleアカウントでサービスアカウントを作成し、カレンダーを再作成し、このサービスアカウントの新しい資格情報を作成しました。 それはそれを再び働かせました。
これは、アカウントに何か起こっていると思いますか?
エラーが発生したアカウントは、ビジネスアカウントのGoogle Appsの有料です。そのアカウントでチケットを記録して返信します。