How to list all reoccurrence meetings from calendar - microsoft-graph-api

I would like to list all events in my calendar (or in a time frame), it works well if they are single instance events. But I was not able to list all meetings set as reoccorruence meetings for 10 weeks, for instance.
Tried the follow apis:
https://learn.microsoft.com/en-us/graph/api/user-list-events?view=graph-rest-1.0
https://graph.microsoft.com/v1.0/me/events?$select=subject,body,bodyPreview,organizer,attendees,start,end,location
https://learn.microsoft.com/en-us/graph/api/event-list-instances?view=graph-rest-1.0
GET /me/events/{id}/instances?startDateTime={start_datetime}&endDateTime={end_datetime}
GET /users/{id | userPrincipalName}/events/{id}/instances?startDateTime={start_datetime}&endDateTime={end_datetime}
GET /groups/{id}/events/{id}/instances?startDateTime={start_datetime}&endDateTime={end_datetime}
What {id} is it? I don't want to inform anything else then the calendar, it seems a meeting id. There is no documentation about it.

Related

Get EventMessage Associated with Event in MS Graph API

I am creating a service that needs to decline events, when certain conditions are met, from a room's perspective and update the event on attendees' calendars.
While declining the meeting is simple, I am struggling to update the event on a user's calendar. I assume that I would do this using update eventMessage.
Right now I have the ID of the event that is declined and I need to associate that event with its eventMessage. Therefore, I am making the following request:
`/users/${roomEmail}/messages?$expand=microsoft.graph.eventMessage/event($select=id;$filter=id eq ${meetingId})`
What I am trying to do is get all messages, then expand so that I see the events associated with each message, then filter each event by its ID until I find the event that I care about. Once I have that event, I can send an update to its eventMessage.
However, I get the error "Parsing Select and Expand failed."
Where am I going wrong?
As the id is not a number value, I believe you may need to add single quotes around the meetingID parameter at the end.
`/users/${roomEmail}/messages?$expand=microsoft.graph.eventMessage/event($select=id;$filter=id eq '${meetingId})'`
https://learn.microsoft.com/en-us/dynamics-nav/using-filter-expressions-in-odata-uris#referencing-different-data-types-in-filter-expressions

Is it possible to get a single event's originalStart with Graph API?

I'm working with Microsoft's Graph API for Outlook calendar events, and I need to fetch the originalStart for exceptions to recurring events on a calendar.
When fetching events using the List events function, I am provided with the events' original start dates, but when I grab a single event using the Get event function, the object returned has no originalStart.
I do receive the event's originalStartTimeZone and originalEndTimeZone, but the original start date is simply missing.
The event resource lists this as a property for events, so I would expect it to be showing up. Any way to get this event without grabbing the entire list of events anew?
I ve checked and confirm originalStart is missing or giving null value. You can look over there as the issue is already known : https://github.com/microsoftgraph/microsoft-graph-docs/issues/4353
I am able to get the originalStart by specifying it in the select query parameter:
https://graph.microsoft.com/v1.0/me/events/<id>?$select=id,subject,originalStart

Synchronizing new calendar events always have the #removed field

I'm syncing calendar events using the #microsoft/microsoft-graph-client npm package with the base url /me/calendarview/delta. It's been working fine until a few days ago. For some reason whenever I create a new calendar event in outlook.office.com and my app syncs, the newly created calendar event has the #removed: {reason: "deleted"} field set.
However when I lookup that same calendar event using the Microsoft Graph Explorer that same event does NOT have the #removed field set. Is there any reason a newly created calendar event would look like it's being deleted during a sync?
I'm using #microsoft/microsoft-graph-client v1.3.0
Steps to recreate:
Create an event using the node graph client by POSTing to /me/calendar/events
Grab a delta of calendar events using /me/calendarview/delta with appropriate deltaLink and access token.
I receive 1 calendar event that has 3 fields, #odata.type, id and #removed. The id field matches the id of the created event in step 1.
If you need more information, let me know. This is affecting some of our users.
Update: I tried a workaround for this issue by calling /me/events/<id> for each #removed calendar entry I receive on a delta sync to verify if the event was truly deleted. However when I call that API via the microsoft-graph-client it returns null. If I make the same GET call via MSFT Graph Explorer then the event is returned.
I left an answer on another question here: https://stackoverflow.com/a/65348721/6806302
In short, I went off yesterday on a hunch inspired by #mattlaabs's comment on the question above, that the startDateTime..endDateTime range of the events delta was to blame.
And in practice, that is exactly the problem. The answer is two part:
Changes to events not in the window always show up in the delta stream as #removed.
The events delta parameters are captured in a "closure", meaning subsequent requests (with a $deltatoken) ignore the startDateTime..endDateTime query parameter.
Understanding both of the above, it seems that the answer is to:
Create wide enough initial startDateTime..endDateTime windows to suite your application's needs
Start new events delta streams (by not providing a $deltatoken) at some defined interval instead of reusing the same one indefinitely

Microsoft Graph's Calendar API doesn't return recurring calendar events

I am using the CalendarView API of Microsoft Graph. Based on the offical documentation: https://graph.microsoft.io/en-us/docs/api-reference/beta/api/user_list_calendarview
I did this:
GET https://graph.microsoft.com/beta/me/calendarview?startDateTime=2016-9-07&endDateTime=2016-10-02
However I don't see any recurring events. I can see other events happens before and after the recurring ones.
More information after the initial posting:
The problem occurs if the date range goes over the week border. For example, I have an recurring event on 2016-09-08, If I set the start date to 2016-09-07 and end date to 2016-09-10, it would work, but if I set the end date to 2016-09-11, the events won't show up.
#Michael Mainer helped to identify the root cause:
The calendar API has a default page size of 10. One should follow the "#odata.nextLink" property to obtain all results. The paged results is not sorted by start date unless "OrderBy" is specifically added.
As Miaosen Wang mention the default page size is 10.
As a workaround you can increase the page size adding the parameters "orderby" and "top" to you query.
params:
$orderby=start/dateTime DESC
$top=100
e.g.
GET https://graph.microsoft.com/beta/me/calendarview?startDateTime=2016-9-07&endDateTime=2016-10-02&%24$orderby=start/dateTime%20DESC"&%24top=100

how to get number of views: Youtube analytics Report query

_analyticService = new YoutubeAnalyticsService(_authenticator = CreateAuthenticator()); ... var result = _analyticService.Reports.Query("channel==myChannelCode", "2013-01-01", "2013-02-02", "views").Fetch();
I have created a new Youtube analytic Service and I have sent the server a query.
My goal is to get the number of views the user has on his videos.
How do I use result to do this?
In your request
_analyticService.Reports.Query("channel==myChannelCode", "2013-01-01", "2013-02-02", "views").Fetch();
you only fetch the views between 1 January to 2 February. To get the full viewcount you would need to get the lifetime view count, try to specify a start and end date that is far away, like start-date=2005-01-01 and end-date=2100-01-01.
You also probably want to specify a filter with the video id of the video you are looking for, like filter=video==_iwmv6644dA Note also that the view count returned by the api don't seem to get updated as quick as the one on the watch page, so may therefore not be exactly the same.
However, this request works well to get the view count for one of my videos:
https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DUCYHMS8hN8s49F93iJuEgG6w&start-date=2005-01-01&end-date=2100-01-01&metrics=views&filters=video%3D%3D_iwmv6644dA&key={YOUR_API_KEY}

Resources