office365 - 使用 Office 365 API 从特定日历获取事件

标签 office365 outlook-restapi

我正在尝试使用 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} 替换为实际 ID,该 ID 是我从另一个返回所有日历组的 API 调用中获得的。

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}

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

感谢您的帮助。

最佳答案

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

关于office365 - 使用 Office 365 API 从特定日历获取事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32191808/

相关文章:

java - Jenkins 通过 SMTP 测试电子邮件配置(连接或出站已关闭)

c# - 将实验性 ADAL 构建中的代码调整为最新的 ADAL 构建

javascript - 使用 msal.js 时保持登录状态

c# - HttpProvider.SendAsync() 空内容

Excel - 从列表中搜索字符串,区分大小写和通配符

Excel公式: If duplicate found in column B,在D列中添加 "Y"值

javascript - SCRIPT5022 : The collection has not been initialized. 尚未请求或请求尚未执行

microsoft-graph-api - 当我创建/更新/删除日历时,收到两次 outlook 休息推送通知

outlook - 在不同时区使用 Outlook 365 API 设置全天日历事件

api - Office 365 REST API - 访问 session 室日历