【发布时间】:2016-12-01 10:16:26
【问题描述】:
我需要通过 API 以编程方式与另一个 Outlook 用户共享我的用户的主要 Microsoft Outlook 日历。
我设法将 Oauth2 授权与正确的范围 (wl.calendars_update) 集成以访问日历。
基于Outlook Calendar REST API reference,我可以成功地从https://outlook.office.com/api/v2.0/me/calendars 检索用户的日历。但我们想要的是通过 API 共享日历。这可能吗?
为了比较,谷歌通过ACLs 做到这一点。共享所需的代码如下所示:
const headers = { Authorization: `Bearer ${req.pre.user.microsoftAccessToken}` };
const params = { scope: { type: 'user', value: google.calendar.mail }, role: 'freeBusyReader' };
return rp.post(`${google.calendar.apiUrl}/primary/acl`, { json: true, body: params, headers })
.then(() => res({ message: req.i18n.__('shareCalendarSuccess') }))
.catch(err => res(normalizeErr(err)));
【问题讨论】:
标签: outlook calendar ms-office google-calendar-api outlook-restapi