【问题标题】:Getting events from specific calendar using office 365 API使用 office 365 API 从特定日历获取事件
【发布时间】:2015-08-24 21:12:58
【问题描述】:

我正在尝试使用 Office 365 API 从特定日历(非默认)获取事件。我从 office 365 API 文档中找到了这个 URL。

GET https://outlook.office.com/api/{version}/me/calendars/{calendar_id}/calendarview?startDateTime={start_datetime}&endDateTime={end_datetime}

我将 {calendar_id} 替换为从另一个返回所有日历组的 API 调用获得的实际 ID。

GET https://outlook.office.com/api/{version}/me/calendargroups

替换所有相关参数后,我收到 HTTP 500 错误。

但我可以使用

为我的默认日历获取事件
GET https://outlook.office.com/api/{version}/me/calendarview?startDateTime={start_datetime}&endDateTime={end_datetime}

如何从特定(非默认)日历中获取事件?

感谢您的帮助。

【问题讨论】:

    标签: office365 outlook-restapi


    【解决方案1】:

    你的表格是对的。但是,您说您从GET https://outlook.office.com/api/{version}/me/calendargroups 获得了ID,它不返回日历,而是返回日历组!因此,您拥有的 ID 可能是问题所在。尝试使用GET https://outlook.office.com/api/{version}/me/calendars 获取实际的日历文件夹,然后使用您要查询的 ID。

    【讨论】:

    • 非常感谢杰森。有效。你是对的,我使用的是日历组 ID,这是错误的。
    • 只是想知道,有没有办法在一次通话中从所有用户日历(默认和其他)中获取事件。我找不到它,因此不得不恢复到其他方式来获取第一个其他日历 ID,然后获取此日历的事件。
    • 我们可以在请求范围内的事件时设置时区吗?
    【解决方案2】:

    如何获取带有“recurence”表达式的日历的所有事件? 使用

    GET  https://outlook.office.com/api/{version}/me/calendars/{calendar_id}/calendarview?startDateTime={start_datetime}&endDateTime={end_datetime}
    

    它返回几个事件,而不是一个带有重复表达式的事件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-15
      相关资源
      最近更新 更多