got HttpError 404 for some times and get to work back !!

54 views
Skip to first unread message

Ahmad

unread,
Mar 26, 2012, 6:39:18 PM3/26/12
to google-ca...@googlegroups.com
some times I get 

<HttpError 404 when requesting https://www.googleapis.com/calendar/v3/calendars/<email_address_here>?alt=json returned "Not Found">

then
I went to google calendar --for that email address-- and changed calendar settings to be public then it worked with no errors,
then I changed the settings back and deleted the calendar and imported it again with no errors.

this happened twice before and i don't know the reason,

I'm using google api python client
and here is my code if it can help:
_______________________________________________________
storage = Storage(CredentialsModel, 'id', request.user, 'credential')
    flow = OAuth2WebServerFlow(
            client_id='00000000.apps.googleusercontent.com',
            client_secret=aaaaaaaaQ__-aaaaaaaaae',
            scope='https://www.googleapis.com/auth/calendar',
            user_agent='appname/1.0',
            )
    credential = storage.get()
    if credential is None or credential.invalid == True:
        authorize_url = flow.step1_get_authorize_url(STEP2_URI)
        f = FlowModel(id=request.user, flow=flow)
        f.save()
        return HttpResponseRedirect(authorize_url)
    else:
        http = httplib2.Http()
        http = credential.authorize(http)
        service = build("calendar", "v3", http=http)
        calendar_id = request.user.email
        calendar = service.calendars().get(calendarId=calendar_id).execute()
________________________________________________________________


thanks in advance

Reply all
Reply to author
Forward
0 new messages