使用Office 365 API从特定日历获取事件 [英] Getting events from specific calendar using office 365 API

查看:266
本文介绍了使用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.

这篇关于使用Office 365 API从特定日历获取事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆