Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get event info from resource id on push notification google calendar

  1. Set channel with google calendar.
  2. Create a google calendar event.
  3. got a push notification contains following data.
  4. X-Goog-Resource-Id,X-Goog-Resource-Uri,X-Goog-Channel-Id

Now i could not find how to get, which event data modified or some event has been created.

How can I find event list by push notification headers data (mentioned in line 4.)

like image 543
sonishubham65 Avatar asked May 05 '17 07:05

sonishubham65


People also ask

How do I see event details on Google Calendar?

In Google Calendar settings, go to “Events from Gmail,” and check the box next to "Show events automatically created by Gmail in my calendar."

How do I find the URL for a Google Calendar event?

On the left side, under "Settings for my calendars," click the name of the calendar you want to share. Copy link. copy the link in "Public URL to this calendar" to share it. copy the link in "Public address in iCal format." The iCal address only works if the calendar is public.

What is ETag Google Calendar?

As per documentation: The ETag (or entity tag) HTTP response header is an identifier for a specific version of a resource. It lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content was not changed.


1 Answers

There is no changed resource/event list in header data. Google just lets you know that something has changed in your calendar.

To get changed resources after every Google Post request, you need to list events of your calendar from google with syncToken and save the new one which will appear as nextSyncToken in response. If you provide syncToken parameter in your request, you will only get the changes from syncToken to now. Google calls this process incremental sync.

https://developers.google.com/google-apps/calendar/v3/sync#incremental_sync

please read syncToken and nextSyncToken parameters from here: https://developers.google.com/google-apps/calendar/v3/reference/events/list

Additional links: How to handle Google Calendar API push notifications?

like image 152
hybor Avatar answered Sep 22 '22 07:09

hybor