Reputation: 3742
I would like to observe the Office 365 Outlook calendar events by using Microsoft Graph. I created a client instance with the @microsoft/microsoft-graph-client package and know how to fetch events from a specific user
const usersResponse: any = await client.api('/users').get();
const allUsers: any[] = usersResponse.value;
const firstUser: any = allUsers[0];
const firstUserId = firstUser.id;
const userEvents = await client.api(`/users/${firstUserId}/calendar/events`).get();
What I basically want to do is to fetch every event that was created, edited or deleted but not for a specific user. Of course I could fetch all users and fetch all events from them but then I would have to observe the users too because some might get added or deleted.
I want to listen to all "company" events in realtime. I think polling every X seconds would be a bad approach. I'm looking for events I can subsribe to like
calendar.on('init', eventsFromNow => {});
calendar.on('eventCreated', event => {});
calendar.on('eventEdited', event => {});
calendar.on('eventDeleted', event => {});
Is there something I can use for that?
Upvotes: 0
Views: 163
Reputation: 33094
This isn't a supported scenario.
More importantly, consider what this would look like at scale. What you're asking for is active monitoring of every evert, for every user and group, across an entire organization. The computational cost of monitoring like this would be staggering.
Upvotes: 1