Getting events from specific calendar using office 365 API

天涯浪子 提交于 2019-12-11 02:57:36

问题


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}

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

After replacing all relevant parameters, i am getting a HTTP 500 error.

But i can get events for my default calendar with

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 ?

Appreciate your help.


回答1:


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.




回答2:


How to get all events of a calendar with "recurence" expression? Using

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

It returns me several events instead of one with the expression recurrence.



来源:https://stackoverflow.com/questions/32191808/getting-events-from-specific-calendar-using-office-365-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!