有一种方法可以从会议请求邮箱中获取日历事件。我正在使用office.js,但看不到任何指示事件ID的字段。看起来,即使更新会议并发送新的请求电子邮件,单个会话中的所有会议请求也都链接到同一日历事件对象。是否可以从“会议室请求”邮箱项目中访问一个唯一的标识符,该标识符可用于查询日历事件。
当前,我这样做的方法是检查日历事件的创建日期是否大于或等于会议请求项目的创建日期或小于Meeting_Request CreatedDate
MeetingRequestCreatedDate <= CalendarEventCreatedDate <= MeetingRequestCreatedDate + (someOffset)
AND
MeetingRequestCreatedDate <= CalendarEventModifiedDate <= MeetingRequestCreatedDate + (someOffset)
我认为偏移量是必要的,因为有时日期不完全同步。实际的代码是这样的:
//It might take a while for the modified date to update on the calendar event
//therefore the margin of error is set to 2seconds
const append = `/me/calendar/events?$select=LastModifiedDateTime,CreatedDateTime,Locations,Location,Organizer&
$filter=(CreatedDateTime gt ${toUTCTimeZone(item.dateTimeCreated)} and CreatedDateTime lt ${toUTCTimeZone(item.dateTimeCreated, 2)}) or
(LastModifiedDateTime gt ${toUTCTimeZone(item.dateTimeCreated)} and LastModifiedDateTime lt ${toUTCTimeZone(item.dateTimeCreated, 2)})
`;
const restUrl = `${Office.context.mailbox.restUrl}/v2.0${append}`;
然后最后我检查一下CalendarEvent == MeetingRequestSender
result.Organizer.EmailAddress.Address == Office.context.mailbox.item.sender.emailAddress
我有两个问题: