简体   繁体   中英

How to expand Microsoft Graph extended properties in calendar events in a calendar view

Using Microsoft Graph SDK, I realised that when I get events from a calendar events collection, the extended properties are in the response:

graphClient.Me.Calendar.Events
.Request()
.Expand("SingleValueExtendedProperties($filter=id eq 'String {00020329-0000-0000-C000-000000000046} Name MyExtendedProperty')")
.Select("SingleValueExtendedProperties")
.GetAsync()

But when I get them from a calendar view collection, the extended properties are omitted:

graphClient.Me.Calendar.CalendarView
.Request(new[]
{
    new QueryOption("StartDateTime", DateTime.UtcNow.AddMonths(-3).ToString("yyyy-MM-dd")),
    new QueryOption("EndDateTime", DateTime.UtcNow.AddMonths(3).ToString("yyyy-MM-dd"))
})
.Expand("SingleValueExtendedProperties($filter=id eq 'String {00020329-0000-0000-C000-000000000046} Name MyExtendedProperty')")
.Select("SingleValueExtendedProperties")
.GetAsync()

Does anyone know if this is a by-design restriction or if there's a way to expand the extended properties in the calendar view?

I tried using Graph API's to expand extended properties in the calendar view and it worked for me.

Sample Request - [Get] https://graph.microsoft.com/v1.0/me/calendar/calendarView?startDateTime=2015-11-26T19:00:00-08:00&endDateTime=2015-11-28T19:00:00-08:0&$expand=singleValueExtendedProperties($filter=id%20eq%20'String%20{66f5a359-4659-4830-9070-00040ec6ac6e}%20Name%20Fun')

在此处输入图片说明

Try and see if you could leverage Rest API's here. Hope this helps. Thanks!

@Shweta was right, calendar view works with the expand even from the SDK.

My mistake was assuming me/calendarView and me/events were supposed to return the same set of events.

Turns out me/calendarView actually returns individual occurrences in a recurring series instead of the series master like in me/events .

This was causing me to mistaken that my extended properties were not included, but in fact it was been pushed out to later pages due to the inclusion of individual occurrences in calendar view.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM