在 calendarview 的 Microsoft Graph api 中获取日历颜色

getting color off calendar in microsoft graph api in calendarview

我正在使用 Microsoft Graph api 中的日历视图,使用以下 url:https://graph.microsoft.com/v1.0/me/calendars/'+calendarId+'/calendarView?$select=subject,bodyPreview,start,end,location,isAllDay,lastModifiedDateTime,iCalUId,categories

一切正常,我得到了我需要的数据,但我同时想得到日历的颜色和十六进制颜色,但我不知道该怎么做,所以我希望其他人能帮忙有了它,

我尝试将 ,calendar 添加到 $select 部分,但没有返回有关这些事件所属日历的任何信息。

我看到这里:https://docs.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0如果我理解正确,我应该可以做到,所以我希望有人能提供帮助。

CalendarView 只会 return 事件对象(或 Exchange 中的基础日历项目)。日历颜色 属性 仅存在于日历中,而不是事件本身的 属性。根据您的要求

https://graph.microsoft.com/v1.0/me/calendars/'+calendarId+'/calendarView?$select=subject,bodyPreview,start,end,location,isAllDay,lastModifiedDateTime,iCalUId,categories

这只会 return 来自日历的事件,其中包含您传入的 calendarId,因此如果您想要日历颜色,您只需要在日历端点上发出单独的请求,例如 Get to

https://graph.microsoft.com/v1.0/me/calendars/'+calendarId+