从Microsoft Exchange提取日历事件

时间:2019-02-12 12:03:20

标签: javascript node.js soap exchange-server exchangewebservices

例如在Apple日历中,我可以从Microsoft Exchange导入日历事件。

我想了解Apple Calendar如何进行这种同步。我想直接在Node.js中提取日历事件。

我已经设置了node-ews并编写了以下脚本:

const EWS = require("node-ews");
const dotenv = require("dotenv");

dotenv.config();

// Exchange server connection info
const ewsConfig = {
  username: process.env.USERNAME,
  password: process.env.PASSWORD,
  host: process.env.HOST
};

// Initialize node-ews
const ews = new EWS(ewsConfig);

// Define EWS API function
const ewsFunction = "SearchMailboxes";

// Define EWS API function args
const ewsArgs = {};

// Query EWS and print resulting JSON to console
ews
  .run(ewsFunction, ewsArgs)
  .then(result => {
    console.log(JSON.stringify(result, null, 2));
  })
  .catch(err => {
    console.log(err.message);
  });

问题是我不知道将ewsFunctionewsArgs使用什么。我已经阅读了文档中的所有EWS操作,但是无法理解使用哪个以及如何正确定义参数。

例如,我曾经使用过https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/getitem-operation-calendar-item,但是当我已经知道ID时,它似乎是用于检索日历项目。

可以从Exchange获取很多日历,因此可能并不难,但我不知道在哪里可以找到信息。

0 个答案:

没有答案
相关问题