2017-12-15 17 views
0

私はGoogleカレンダーAPIにリクエストするためにPythonクライアントライブラリーを使用しています。それは正常に動作しますが、カレンダーのすべてのイベントを取得していません。しかし、私がAPIのエクスプローラを見ると、私はすべてを取得し、別の形式で取得します。たとえば、APIエクスプローラには、必要な「要約」キーが含まれています。何故ですか?GoogleカレンダーAPIがAPIエクスプローラーと異なる結果を返す

credentials = ServiceAccountCredentials.from_json_keyfile_name(SERVICE_ACCOUNT_JSON_FILE_PATH, scopes) 
http_auth = credentials.authorize(Http()) 

calendar = build('calendar', 'v3', credentials=credentials) 

currentTime = datetime.datetime.now() 
maxTime = currentTime + relativedelta(months=+1) 

#do this to get all events on this day 
maxTime = maxTime.replace(minute=59, hour=23, second=59) 

currentTime = currentTime.isoformat('T') + '-06:00' 
maxTime = maxTime.isoformat('T') + '-06:00' 

response = calendar.events().list(calendarId="*******", singleEvents=True, maxResults=2500, showHiddenInvitations=True, timeMin=currentTime, timeMax=maxTime).execute() 

return JsonResponse(response) 

答えて

0

カレンダーAPIエクスプローラが「summary」を含むResource representationsで見つけることができるすべてのプロパティ。 APIリクエストが成功した後にそのすべてを取得するには、q parameter' * 'を指定して、Event.listに完全な応答が必要であることを伝えてください。

関連する問題