【问题标题】:How to expand Microsoft Graph extended properties in calendar events in a calendar view如何在日历视图中展开日历事件中的 Microsoft Graph 扩展属性
【发布时间】:2021-07-05 22:52:56
【问题描述】:

使用 Microsoft Graph SDK,我意识到当我从日历事件集合中获取事件时,扩展属性在响应中:

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

但是当我从日历视图集合中获取它们时,扩展属性被省略了:

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()

有谁知道这是设计限制还是有办法在日历视图中扩展扩展属性?

【问题讨论】:

    标签: c# .net microsoft-graph-api microsoft-graph-sdks


    【解决方案1】:

    我尝试使用 Graph API 来扩展日历视图中的扩展属性,它对我有用。

    样品请求 - [获取] 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')

    试试看你是否可以在这里利用 Rest API。 希望这可以帮助。谢谢!

    【讨论】:

      【解决方案2】:

      @Shweta 是对的,日历视图甚至可以通过 SDK 进行扩展。

      我的错误是假设 me/calendarViewme/events 应该返回同一组事件。

      原来me/calendarView 实际上返回循环系列中的个别事​​件,而不是像me/events 中的系列主控。

      这让我误以为我的扩展属性不包括在内,但实际上由于日历视图中包含个别事件,它已被推到后面的页面。

      【讨论】:

        猜你喜欢
        • 2011-02-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-02-03
        • 1970-01-01
        • 1970-01-01
        • 2014-03-24
        • 2021-08-18
        相关资源
        最近更新 更多