I need to share the main microsoft outlook calendar of my user with another Outlook user programatically, via an API.
I managed to integrate Oauth2 authorization with the correct scopes (wl.calendars_update
) to access calendar.
Based on the Outlook Calendar REST API reference I could successfully retrieve the user's calendars from https://outlook.office.com/api/v2.0/me/calendars
. But what we want is to share a calendar via an API. Is this possible?
For comparison google does this via ACLs. And the code required for sharing is smth like this below:
const headers = { Authorization: `Bearer ${req.pre.user.microsoftAccessToken}` };
const params = { scope: { type: 'user', value: google.calendar.mail }, role: 'freeBusyReader' };
return rp.post(`${google.calendar.apiUrl}/primary/acl`, { json: true, body: params, headers })
.then(() => res({ message: req.i18n.__('shareCalendarSuccess') }))
.catch(err => res(normalizeErr(err)));