I can read calendar details using 2-legged oAuth but I can't figure out how
to *insert *a new entry. ClientLogin works fine, just not 2-legged oAuth.
This is my first attempt at 2LO.
Here is my code:
Protected Sub updateCalendar2()
Try
' create an OAuth factory to use
Dim requestFactory As New GOAuthRequestFactory("cl",
"myDomain.com-MyApp-v1")
requestFactory.ConsumerKey = "myDomain.com"
requestFactory.ConsumerSecret = "myConsumerSecret"
Dim calendarUri As Uri = New
OAuthUri("https://www.google.com/calendar/feeds/default/private/full",
"[email protected]", "myDomain.com")
Dim service As New CalendarService("myDomain.com-MyApp-v1")
service.RequestFactory = requestFactory
'''''''''''''''''''''''''''''''''''''''''''''
Dim entry As New EventEntry()
entry.Title.Text = "Tennis with Beth"
entry.Content.Content = "Meet for a quick lesson."
Dim eventTime As New [When](DateTime.Now,
DateTime.Now.AddHours(2))
entry.Times.Add(eventTime)
Dim postUri As New Uri(calendarUri.ToString)
' Send the request and receive the response:
Dim insertedEntry As AtomEntry = service.Insert(postUri, entry)
'''''''''''''''''''''''''''''''''''''''''''''''
Catch ex As Exception
myDiv.InnerHtml = "Fail. " & ex.Message & ": " &
ex.StackTrace.ToString
End Try
End Sub
Thanks for the help!
Jason
--
You received this message because you are subscribed to the Google
Groups "Google Calendar Data API" 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://code.google.com/apis/calendar/community/forum.html