Different serach results for Calendarview and Events - microsoft-graph-api

I was trying following two queries and only 1st query give correct events results according the given date range.
Is there any reason for giving all events when i use me/events in 2nd request ?
1st
https://graph.microsoft.com/v1.0/me/calendarview?startdatetime=2020-07-02T10:20:52.032Z&enddatetime=2020-07-09T10:20:52.032Z
2nd
https://graph.microsoft.com/v1.0/me/events?startdatetime=2020-07-02T10:20:52.032Z&enddatetime=2020-07-09T10:20:52.032Z
Response of 2nd query

The startDateTime and endDateTime query parameters aren't used by the /me/events endpoint. Those are specific to /me/calendarview.
Calendar view requires a "time window", because it expands recurring events and returns an entry for each occurrence that happens between those times. If it wasn't bounded, this could result in infinite occurrences, since you can create recurring events with no end date :).
The /me/events endpoint doesn't expand recurring events, so it just returns the series masters and single-occurrences on the calendar.

Related

Basic AWQL request - CAMPAING_PERFORMANCE split by "date" only

I face strange behavior on my Adwords API response, which brakes a logic of our reports.
Here is my AWQL:
SELECT Date,Ctr FROM CAMPAIGN_PERFORMANCE_REPORT DURING 20181206, 20181206
Response:
Report Day,CTR
2018-12-06,0.00%
2018-12-06,3.23%
Why do I get 2 rows of results, it should be only one (same date). I asked only for one date. Same thing with a different range of dates.
It feels to me like Adwords splits the results by CampaignIds.
It is possible to get "total" result, split by date?
CAMPAIGN_PERFOMANCE_REPORT is segmented by campaign. If you want Ctr by date across an account you need to use ACCOUNT_PERFORMANCE_REPORT instead

How to find recurrence exceptions through Microsoft Outlook Calendar Graph API

I'm currently using the Microsoft Graph API to sync calendar events to my local application. On my end, I don't care to save each individual occurrence in a series, but prefer instead to just save the series master and then extrapolate out the instances of the series myself. For this reason, I am using the /me/events call rather than the /me/calendarView call.
My problem is when editing a single occurrence in a series. After editing the single occurrence, I make the /me/events call and I can see the newly added "Exception" type -- which is great. However, I don't see how to relate that new event back to which occurrence was changed to cause the exception.
For example, if I have a weekly meeting on Monday at noon, and I change today's meeting from noon to 2:00, it's pretty easy to tell that today's meeting is the one that changed. But if I change today's meeting to Friday, how can I tell that it was today's meeting that changed and not next week's? Keep in mind that I am only storing the master, and not every single calendarView occurrence.
Another example is if I delete an occurrence. In this case, the /me/calendarView call will simply not return that occurrence anymore. No exception type is generated. And the series master returned from the /me/events call doesn't change at all to indicate that a date is missing.
The format that I'm used to is something like the iCal/vCal format, where there is a start date, end date, and then a list of exception dates. Using that format, I can easily tell from the series master which dates to skip, without needing to "render" the entire occurrence and skip the exceptions. And if an occurrence is deleted, it is added to the EXDATE list and then it is never considered on rendering. Does the Microsoft Graph API not have an easy way to see these changed/deleted occurrences?
I was having a similar issue, but I think I've now realized that Microsoft does not allow recurring events to move later than the next instance, or earlier than the preceding one (at least while using Outlook calendar in the browser). So you can always assume that the 3rd event is 3rd in the series, the 4th is 4th, etc.
So as long as you know the series number, you can locate it by getting all of the instances with /me/events/[event_id]/instances?startDateTime=[start_date_time]&endDateTime=[end_date_time].
The error in Outlook Calendar when I do this isn't very clear, so maybe something else is up, but I am able to move the exception events otherwise. Unfortunately, I'm not sure if there's a definite way to know what end_date_time to use, as events can be moved indefinitely later.
Based on the response object from the event marked as an exception, you can use the seriesMasterId to relate the exception to its parent recurrence.

getting endDate=0001-01-01 in recurring event Range from Outlook graph API

I am trying to get a calendar event from Outlook365 using microsoft graph API. In case of recurring event the end date is coming as endDate=0001-01-01.
The same is for all types of recurring events like NoEnd and Numbered. Even when the end date is fixed
That's expected behavior. The endDate is only relevant on end date ranges, for noEnd and numbered there is no end date set on the range. See https://learn.microsoft.com/en-us/outlook/rest/recurrence-rules#recurrence-ranges

CalendarView and DeltaToken in different time range with Microsoft Graph API

From the Graph Documentation:
if you want a calendarView for a specific time range you use the query
GET https://graph.microsoft.com/v1.0/me/calendar/calendarView?startDateTime=2017-01-01T19:00:00.0000000&endDateTime=2017-01-07T19:00:00.0000000
if you want a delta token to get the changes in a calendarView you use the query
GET https://graph.microsoft.com/v1.0/me/calendarview/delta?startdatetime={start_datetime}&enddatetime={end_datetime}
My problem is taht I need to get all the events from a specific date at the beginning of my program, but after that I'm interesting to track changes of events from another date.
So I'm wondering if is it possible to get a calendarView for a specific time range and a delta token for another time range in a single query?
It is not possible to do this in a single query. Please issue two separate queries.
Thanks!
Sri

Microsoft graph API: getting 5 next instances of recurring meeting

is there a way to query for next 5 instances of given series? I am querying using time-frame:
1. ask for all the meetings for next 7 days for all user events
2. Go over each event fetched and check if event has masterSerieId
3. Return matching instances.
This feels (and is) a bit painful.
Can i request next X instances of master series right away? I can't just simply or 'simply' get them based on recurrence rule, as some might have expired.
I could image I could ask for a year ahead and pass as a query parameter masterSeriesId and limit output with $top. Is that right approach?
Based on this document, you could call /events//instances – given a start time, returns all instances in the requested time frame of the meeting specified by the provided series master ID

Resources