Search code examples
ioseventspostgoogle-calendar-apifeed

How to post event to particular google calendar using feed URL


I am trying to post an event to a particular google calendar. I am using the following URL to post the event:
https://www.google.com/calendar/feeds/CALENDAR-ID/private/full

Using this I get this error:

<HTML>
<HEAD>
    <TITLE>Authorization required</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
    <H1>Authorization required</H1>
    <H2>Error 401</H2>
</BODY>

I understand that I need to request authorization to post on the calendar but I would like to post the event in my own calendar.

My questions:
1 - Do I need to use OAuth to post an event in my own calendar ?
2 - If not, is there any special URL (like magic-cookie) to use with a read-write access ?
3 - I have a Google API Key but I don't know if I can use it in this case and how it should be used ?

I am trying to post the event from an iOS application using NSURLConnection. Here is the details:

{ "data": { "title": "Tennis with Beth", "details": "Meet for a quick lesson.", "transparency": "opaque", "status": "pending", "location": "Rolling Lawn Courts", "when": [ { "start": "2013-08-07T15:00:00.000Z", "end": "2013-08-07T17:00:00.000Z" } ] } }

Headers:

Content-type: application/json

Thank you for your help, I know there is a lot of similar question over internet but everything I try doesn't work and I don't understand the OAuth things in documentation (as I never used OAuth). Also I can;t find in google documentation the case when you want your users to post in a particular calendar.


Solution

  • I found another post on StackOverflow which deals exactly with what I was looking for. The post explain the method using PHP but the process is still the same for iOS.

    Google Calendar API v3 hardcoded credentials