Best approach to update an existing event in multiple Microsoft accounts using Microsoft Graph API - api

I am working on a calendar synchronization between my application and personal calendars of the users. The idea is that every time an event is created or updated, this event is sent to the personal calendar of the users (they can choose syncing to Google Calendar and/or Microsoft accounts calendar).
I have this complete flow working with Google Calendar and now I am working with Microsoft oAuth and Graph API to make it work either for MS Calendars.
Currently, for MS, I have the following scenario implemented and working:
User authorizes the application to access its calendar through consent page
Server exchanges the authorization code for an access token
I can insert an event in user's calendar using its access token as Authorzation header through Microsoft Graph API (POST https://graph.microsoft.com/v1.0/me/events)
Now I am trying to figure out how I can manage event updates (when start date changes, for instance, how I will send this update for each user's MS account), knowing the following constraints of Microsoft Events API:
Property "ICalUId" is generated by MS API itself and returned in the response of Insert endpoint. I can't insert an event with my own ICalUId. This is possible with Google Calendar and very useful, because if I send an event with an existing iCalUId to import endpoint, Google updates this existing event with the sent data, and if the iCalUId doesn't exist, Google creates the event (it performs an upsert-like action).
For each event inserted at different users calendar, a new "ICalUId" is generated, even if I am sending the same event object to insert. So I get many iCalUId's for the same event, this adds complex in tracking this event in users calendars, different from Google Calendar as I mentioned before.
So that's the challenge I am facing right now. Any ideas on how I can achieve this?
Thanks in advance!

Related

How to fetch RealTime MS Outlook 365 inbox?

I have integrated the On behalf User flow for my project requirement.
How do I access the multiple user's email account and fetch the Realtime Inbox and Save to DB on basis of Authorization token of every user which expires every hour in API based application?
Did you read about Change notifications in Microsoft Graph?
There is a possibility to send webhook on specific change - for example, Outlook message:
https://learn.microsoft.com/en-us/graph/webhooks#supported-resources
There is a whole tutorial for how to receive those notifications:
https://learn.microsoft.com/en-us/graph/tutorials/change-notifications

How to - Google Calendar event creator is not a Google user

We have web application including calendar functionality. Now I want to add possibility to link your local calendar with Google Calendar through API.
As not every user will link the calendar I expect following situation to occure (often):
User has not linked her Google Calendar with our web application;
User is creating event in our application;
User adds another user to the event who has synced her application calendar to Google Calendar and has expetation that all her events are evenly distributed;
How to create event to that participant user Google calendar so that she is participant not organiser?
Why it is important - when invited user updates any information in Google in regular case she gets notice by Google that all her changes can be overwritten by organiser. Also some fields cannot be changed at all from mobile.
There are limits on how many events we can create through the API as organizers by ourselves so at this point we are not considering creating artificial google users to be creators for the events.

Notifications are being sent to guests randomly when event is created/updated with Google Calendar V3 API

Calendar notifications are sent out to attendees though the send_notification parameter is false in the API (default is false). But this is happening randomly, not for every user calendar that our app was creating event using insert/update API.
We are not sure if this is an issue on Google side. As we are seeing it randomly it has become very difficult for us to troubleshoot. Appreciate any help from Google.
Attendees in the event could be Google hosted domain users or MS Exchange users. Every one is getting invitation.
Thanks in advance.
durga

Log in with a specific username with Google API

I am developing a web app for a group, and I want to be able to let anyone in the group create an event and add it to the group's calendar through the app. I was able to get the basic functionality working using Google Calendar API v3 for Javascript -- you could fill out a form with the event's start/end times, title, information, etc, and it could insert that event into the calendar.
But the problem is with authentication. If a user is logged in to a Google account that is not given permission to create events on the calendar, they are unable to add the event (Javascript writes "Forbidden" to the console). If I log out of all Google accounts and then sign in with the account that owns the calendar, the event is created with no problems (that makes sense).
Adding every single person in the group to the edit-permissions on the calendar seems like too much of a "brute force" method.
Is there a way to always authenticate the Google account that owns the calendar? Or, better yet, is there a way just to force authentication in general, even if someone is already logged in to Google / authorized to the app? Some people in the group know the calendar login/password, so if I could always bring up a Google login screen, they could just enter the calendar account information and then add the event from there. Again, I'm using Javascript (not much documentation on this...).
Thanks!
Have a look at Service Accounts. That way the calendar is owned by the application, and so the application will always have permission to update it.
If you want to avoid authentication problem from other opened session in user browser, you have to authenticate on the calendar, using server side library.
check this link:
https://developers.google.com/google-apps/calendar/auth
it bounces you from one article to other, but at the end you should get all information.

Google Tasks API authorization

I can see many related questions on SO, but none that answers exactly what I'm confused with.
I'm using Google Calendar API in a .NET desktop application that allows user to provide his/her username/password, logs in on his behalf and adds some events to the calendar. Now I want to do exactly the same thing for Tasks feature. I'm trying to use Google Tasks API for this, but have been told that I need to do some OAuth kind of authentication, and even before that, I need to go to my gmail account and set permissions and get my project "key" to enable it.
Now does every user of my application need to do these steps in their Gmail account? Or do I need to do this in MY gmail account once and then my application code will be able to use the generated project "key" to enable my users to add tasks to THEIR gmail tasks list?
Figured it out. For anyone having a hard time understanding this, here it is:
The "key" generation step needs to be done only once per application, not for each user who's going to use your application. To generate a key, login to your Google Account and go to Google APIs Console page. Click API Access button and that's where you can generate keys for different kinds of applications like browser apps, desktop apps, Android apps etc. After registration, you'll need to take Client ID, Client secret and API key from this page and put them into the code. Sample code (.NET) for task creation and several other Google features is available here.
Once your user runs your application, he'll be taken to his Google account in his default browser where he'll be asked if he wants to allow this application to write to his calendar/tasks list. This page will display your logo and description text too that you can provide at registration time. Once allowed, this step won't be required again in the next one hour (this may be adjustable, i don't know yet).