2016-05-11 6 views
0

私は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を参照してください

Google API requests graph

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の有料です。そのアカウントでチケットを記録して返信します。

答えて

0

このdocumentationには、同じエラーが表示されています。推奨されるアクションは、pageです。

GoogleカレンダーAPIには、1日あたり1,000,000件のクエリの上限があります。

プロジェクトの請求を有効にしている場合は、各APIのクォータの割合を確認できます。 APIセクションのAPIライブラリおよび有効APIリンクからクォータを表示および変更できます。 APIライブラリリストまたは有効APIページからAPIを選択すると、そのAPIの概要、使用方法、およびクォータリンクが表示されます。 クォータを選択すると、クォータ関連の設定を表示および変更できます。 を選択する使用方法は、使用状況の統計情報と応答コードとメソッド情報を提供します。

Google APIコンソールプロジェクトについての回答hereの最初の部分に従ってください。

INTEGRATION WITH GOOGLE CALENDAR APIについてもこの問題を確認してください。ログを分析した後、私は

無料のGoogle Appsを作成しための限度以下

を見つけ

0

は、ユーザーのために アカウント:最初 :ドメインの電子メールが累積 を制限100人のExtenalゲスト:1外部ゲスト数:40分

例: いずれかのトークンを送ることができます *。イベントごとに100人のゲスト - 2人のゲストを持つ50のイベント *。 100ゲストを持つ25のイベント - イベントにつき4名 1日あたりの

制限:36人のゲスト ウィーク:252人のゲスト 月:購入GSuiteカレンダーAPIは、1000年お客様のリクエストの初期限度を与える〜1080人のゲスト

https://github.com/manjeshpv/gsuite-google-calendar-api-limits

関連する問題