4

I am creating an Application for Google calendar integration. I am trying to get the notification from Google when any one manually change the Google calendar event. So have created a channel between Google and with my application. Now the problem is that when google is sending the response header to my Redirect URI then we don't have any description that where their is a change to calendar. Please check the reply that we will get

POST https://mydomain.com/notifications // Your receiving URL.
Content-Type: application/json; utf-8
Content-Length: 0
X-Goog-Channel-ID: 4ba78bf0-6a47-11e2-bcfd-0800200c9a66
X-Goog-Channel-Token: 398348u3tu83ut8uu38
X-Goog-Channel-Expiration: 1367869013915
X-Goog-Resource-ID:  ret08u3rv24htgh289g
X-Goog-Resource-URI: https://www.googleapis.com/calendar/v3/calendars/my_calendar@gmail.com/events
X-Goog-Resource-State:  exists
X-Goog-Message-Number: 10

So can any some guide me how can i get the description that where there is a change to event.

Himanshu Jain
  • 518
  • 4
  • 20

1 Answers1

1

This is final and correct reply (push notification), or at least I am receiving exactly the same. I would suggest you to save last sync date together with channel data and each time when you receive such notification, you call Google API with request for events that have been changed since last sync. The only problem I have is that there is one important thing missing - Google server time. Time on my server is not exactly same as the time on google and I have to make an adjustment to updateMin parameter before sending a sync request (so it's not a simple "now()"). And after you get updated events, don't forget to save last sync date again :)

  • Is there any function in google calendar API for checking the updated events during a period of time. – Himanshu Jain Sep 16 '13 at 07:20
  • 1
    Using updatedMin is not recommended. Sync tokens (https://developers.google.com/google-apps/calendar/v3/sync) are the way to go ;) – luc Apr 08 '15 at 21:44