如何获取Outlook日历事件以与PHP日历同步

时间:2018-11-19 05:58:56

标签: php outlook-restapi

如何获取Outlook事件日历并与PHP日历同步?

我已经尝试过了:

var req = new XMLHttpRequest();
req.open("POST", "https://graph.microsoft.com/v1.0/me/events");
req.setRequestHeader("authorization", "Bearer " + accessToken);
req.setRequestHeader("content-type", "application/json");
req.onload = function (e) {
    if (req.readyState === 4) {
        // Check if the get was successful
        if (req.status === 201) {
            console.log(req.response);
        }
    }
};
req.onerror = function (e) {
    // Catching errors
};
req.send(jsonData);

对PHP示例有任何想法吗?

1 个答案:

答案 0 :(得分:1)

如果要使Outlook日历事件与PHP日历同步,则需要在所有同步请求中指定Prefer: odata.track-changes标头,但那些包含从先前同步请求返回的skipToken的请求除外。

有关更多信息,您可以参考以下链接:

Sync events