function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anand Avinash DosapatiAnand Avinash Dosapati 

How to get event id from Google Calendar

Hello Gurus,

I am a newbie for apex & integrations.
In my org, ScheduleOnce was used to sync SF events to Google Calendar events for Create/Delete actions. Now, I would like to a custom integration leveraging Trigger (After Update) to call Delete API https://developers.google.com/calendar/v3/reference/events/delete when the event status is set to 'Cancelled'. To delete an event, EventId should be passed. The only way I could think of to get the Google Event ID is to pass the subject, start and end times and get it. kindly provide some inputs on how to get the Google Event ID.
https://developers.google.com/calendar/v3/reference/events/get

Thanks in advance
AbhishekAbhishek (Salesforce Developers) 
Hi Anand,

1. Click the event in your Google Calendar.

2. It will take you to a page with a URL such as https://calendar.google.com/calendar/render?pli=1#eventpage_6%7Ceid-NGh0Z3BtbTFobWFrNzQ0cjBrYmtkY29kYXIgZXVndTlrYW4xZGRpMXBtaTZzazNpYjWoNmdAZw-1-0-

3. Look for "eid" in the URL.

4. Select and copy the string between eid- and the next -. (In my example here, it is NGh0Z3BtbTFobWFrNzQ0cjBrYmtkY29kYXIgZXVndTlrYW4xZGRpMXBtaTZzazNpYjWoNmdAZw.)

5. Now you need to decode from Base64 format. You could paste that string into a tool such as https://www.base64decode.org/.

6. The result will be two strings separated by a space. The first string is your Event ID.

Please follow the steps.

For your reference, please check the below article too,

https://support.workato.com/support/solutions/articles/1000239293-google-calendar-where-do-i-find-google-calendar-event-id-required-when-updating-a-google-calendar-ev

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Regards,
​​​​​​​Salesforce Support.
Anand Avinash DosapatiAnand Avinash Dosapati
Hello Abhishek,

Thanks for your response. I would like to automate it using Apex & APIs. But the steps you provided are for the manual process. Correct me if I am wrong.

Thanks
AbhishekAbhishek (Salesforce Developers) 
Yes, Anand, you are right.

Right now we don't have exact code to suggest you, but please go through the below articles,

https://salesforce.stackexchange.com/questions/122112/create-a-google-calendar-event-from-salesforce

https://success.salesforce.com/answers?id=9063A000000e7zXQAQ

I might help you for sure.
Anand Avinash DosapatiAnand Avinash Dosapati
Hi Abishek,

I am afriad, the content you are pointing me to is totally irrelevant. I will wait for others suggestions. Thanks for your support
AbhishekAbhishek (Salesforce Developers) 
Anand, it's unfortunate my suggestions didn't work as I mentioned Right now we don't have exact code to suggest you.

 
sachinarorasfsachinarorasf
Hi Anand,

If you know the corresponding calendarID, you may use Events: list.

By sending HTTP request with the calendarId parameter, you can retrieve eventId. Request like:

GET https://www.googleapis.com/calendar/v3/calendars/calendarId/events

If the request is successful, this method may return a response body with either single one-off events and instances of recurring events.

To know more use the below link:
https://developers.google.com/calendar/v3/reference/events/list

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Sachin Arora
www.sachinsf.com