使用Office 365 API从特定日历获取事件
我正在尝试使用Office 365 API从特定日历(非默认)获取事件.我从office 365 API文档中找到了此URL.
I am trying to get events from specific calendar (non default) using Office 365 API. I found this URL from the office 365 API docs.
GET https://outlook.office.com/api/{version}/me/calendars/{calendar_id}/calendarview?startDateTime={start_datetime}&endDateTime={end_datetime}
我将{calendar_id}替换为我从另一个API调用(返回所有日历组)获得的实际ID的位置.
Where i replaced {calendar_id} with actual ID which i got from another API call which returns all calendar groups.
GET https://outlook.office.com/api/{version}/me/calendargroups
替换所有相关参数后,出现HTTP 500错误.
After replacing all relevant parameters, i am getting a HTTP 500 error.
但是我可以使用
GET https://outlook.office.com/api/{version}/me/calendarview?startDateTime={start_datetime}&endDateTime={end_datetime}
如何从特定(非默认)日历中获取事件?
How can i get events from specific (non default) calendar ?
感谢您的帮助.
您所拥有的表格是正确的.但是,您说您是从GET https://outlook.office.com/api/{version}/me/calendargroups
获得的ID,它不返回日历,而是返回日历组!因此,您拥有的ID可能是问题所在.尝试执行GET https://outlook.office.com/api/{version}/me/calendars
来获取实际的日历文件夹,然后使用您要查询的文件夹中的ID.
The form you have is right. However, you said you got the ID from GET https://outlook.office.com/api/{version}/me/calendargroups
, which doesn't return calendars, but calendar groups! So the ID you have is likely the issue. Try doing a GET https://outlook.office.com/api/{version}/me/calendars
to get the actual calendar folders, then use the ID from the one you want to query.