Skip to content Skip to sidebar Skip to footer

HttpError 401 "Login Required" While Using Calendar V3 Api Python To Insert Event

I am using python and appengine to create an application that uses Google Calendar API (V3). I am able to list events, from multiple calendars etc. However, I am running into probl

Solution 1:

Found out how to resolve the problem.

I needed to change post() method to look something like this:

@decorator.oauth_aware    
def post(self):

if decorator.has_credentials():          
    #event_name = self.request.get('event-name')
    event = {  
     'summary': self.request.get('summary'),  
     'location': self.request.get('place'),  
     'status' : self.request.get('status'),
     'start': {    
               'dateTime': '2013-05-11T10:00:00.000-07:00'  ,
               'timeZone': 'America/New_York'
               },  
     'end': {    
             'dateTime': '2013-05-11T10:25:00.000-07:00',
             'timeZone': 'America/New_York'  
             },  
    }
    http = decorator.http()
    request = service.events().insert(calendarId='MyCalendarId', body=event).execute(http=http)
    :
    :

The solution is actually based on this answer.


Post a Comment for "HttpError 401 "Login Required" While Using Calendar V3 Api Python To Insert Event"