调用Microsoft Graph API CalendarView delta时如何屏蔽重复事件实例?
Fix: Get Only Recurring Event Masters & Exceptions in Calendar Delta Queries
I’ve run into this exact issue with endless recurring event instances cluttering delta results—total pain. Here’s the straightforward solution to get only the changes you care about:
1. Use the type Field to Filter Out Regular Instances
Every event in the Graph API has a type property that categorizes recurrence-related items:
seriesMaster: The parent event that defines the entire recurring series (you want this)occurrence: A standard, unmodified instance of the series (you want to exclude this)exception: A modified instance of the series (e.g., a single meeting moved—you want this)
Add a $filter parameter to your delta query to exclude regular occurrences:
GET /me/calendar/delta?$filter=type ne 'occurrence'
2. What This Does for You
- When the core recurring series is updated (like changing the recurrence pattern or meeting title), the
seriesMasterevent will appear in your delta results—alerting you that the entire series has changed. - Any exceptions to the series (modified instances) will show up as
exceptionevents, so you won’t miss those one-off changes. - All the redundant, unmodified
occurrenceinstances get stripped out entirely, cleaning up your results.
3. Optional: Trim Payload with $select
To make your responses even leaner, add a $select parameter to only fetch the fields your application needs:
GET /me/calendar/delta?$filter=type ne 'occurrence'&$select=id,subject,type,recurrence,start,end
Quick Checks
- Ensure you’re using Graph API v1.0 (or beta for testing) — the
typefilter is supported in both, but v1.0 is best for production. - If you’re paginating through delta results, apply the same
$filterto every page request to keep the filter active.
内容的提问来源于stack exchange,提问作者Judith Ting
相关产品推荐
相关产品推荐

