Hi I've been trying to add a calendar to a user's Google Calendar
account using the two legged Oauth system. I've been working off the
example in the gdata blog(http://gdatatips.blogspot.com/2008/11/2-
legged-oauth-in-python.html)

I've tested the example and it seems to work.

The response I get from the server tells me that there isn't an
authorization header on the request.

I believe I understand the authorization header concept. I am not
really understanding why the GetContactsFeed in the example is
generating an Oauth authorization header but the
InsertCalendarSubscription is not.



import gdata.calendar.service
import gdata.service
import atom.service
import gdata.calendar
import atom
import getopt
import sys
import string
import time
import gdata.auth
import gdata.calendar
import gdata.calendar.service

CONSUMER_KEY = 'domain.com'
CONSUMER_SECRET = 'secret'
CALENDAR_URL = 'http://www.google.com/calendar/feeds/default/
allcalendars/full'

calendar_service = gdata.calendar.service.CalendarService()
calendar_service.SetOAuthInputParameters(
    gdata.auth.OAuthSignatureMethod.HMAC_SHA1, CONSUMER_KEY,
    consumer_secret=CONSUMER_SECRET, two_legged_oauth=True)
user = '[email protected]'
calendar = gdata.calendar.CalendarListEntry()
calendar.id = atom.Id
(text='reametrix.com_39393138343834352d393...@resource.calendar.google.com')
returned_calendar = calendar_service.InsertCalendarSubscription
(calendar,{'xoauth_requestor_id': user})

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Apps APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to