2016-12-01 105 views
2

我需要通过API以编程方式与另一个Outlook用户共享用户的主要Microsoft Outlook日历。通过API共享Outlook日历通过API

我设法将Oauth2授权与正确的范围(wl.calendars_update)集成以访问日历。

基于Outlook Calendar REST API reference,我可以成功地从https://outlook.office.com/api/v2.0/me/calendars检索用户的日历。但我们想要的是通过API共享日历。这可能吗?

为了进行比较,谷歌是通过ACL s来完成的。而共享所需的代码是这样的如下:

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))); 

回答