node.js - 使用 NodeJS 在 Outlook 中创建日历事件
问题描述
我需要使用 NodeJS 脚本在 Outlook 中创建一个日历事件。我已经搜索了每个地方并尝试了不同的 npm 包,但我没有得到解决方案。
我已经尝试过Node-Outlook NPM 包,但文档不清楚如何创建日历事件。
var outlook = require('node-outlook');
var newEvent = {
"Subject": "Discuss the Calendar REST API",
"Body": {
"ContentType": "HTML",
"Content": "I think it will meet our requirements!"
}
};
let createEventParameters = {
token: ['Access token'],
event: newEvent,
user : <user>
};
outlook.calendar.createEvents(createEventParameters, function (error, event) {
if(error) {
console.log(error);
} else {
console.log(event);
}
});
这个 npm 包返回错误:
REST request returned 401; body: {"error":{"code":"InvalidAudience","message":"The audience claim value is invalid 'aud'.
请帮我解决这个问题,如果您知道创建日历事件的任何不同方式,请提出建议。
谢谢
解决方案
尝试在 Azure 配置中的 API 权限中设置此权限 Calendars.ReadWrite
推荐阅读
- java - 带有 JDK 11 的 TOMCAT 7.0.92:- 错误 localhost-startStop-1 org.apache.catalina.startup.ContextConfig - 无法处理 Jar tools.jar 的注释
- python - Python 告诉我 66 <= 17
- angular - Typescript -> 知道给定的接口是否在类型别名中
- javascript - Bootstrap Datepicker 仅年份不绑定
- git - 如何将未提交的更改放在 SourceTree 的新分支上?
- c++ - 如何在 C++ 中使用另一个类的值?
- kotlin - Kotlin - 将集合转换为数组列表
- c# - 使用 System.Management.Automation 调用 powershell 时如何从远程命令传递警告和详细流?
- angular - ../node_modules/@angular/http/src/version.d.ts(13,25) 中的错误:错误 TS2307:找不到模块“@angular/core”
- java - iText 7:将图像设置为多次出现的按钮