使用 Node.js 创建定期 Outlook 日历事件
Create Recurring Outlook Calendar Event using Node.js
我正在尝试在节点中使用Outlook Rest API创建重复事件.js为此我浏览了Microsoft提供的文档,但没有找到示例示例,但是我收到错误
{
"error": {
"code": "RequestBodyRead",
"message": "An unexpected 'PrimitiveValue' node was found when reading from the JSON reader. A 'StartObject' node was expected."
}
}
我的代码:
var jsonBody = {
"Subject": "test event",
"Body": {
"ContentType": "HTML",
"Content": "sadsad"
},
"Start": "2016-05-27T00:00:00.000Z",
"End": "2016-05-27T00:30:00.000Z",
"Attendees": result,
"Type":"Occurrence",
"Recurrence": {
"Pattern": {
"DayOfMonth": 0,
"Month": 0,
"Type": "Daily",
"Interval": 3,
"FirstDayOfWeek": "Sunday"
},
"Range": {
"StartDate": "2015-05-27T00:00:00Z",
"EndDate": "0001-01-01T00:00:00Z",
"NumberOfOccurrences": 0,
"Type": "NoEnd"
}
}
};
var optionsForCreatingcalendar = {
uri: 'https://outlook.office.com/api/v2.0/me/events',
port: 443,
method: 'POST',
headers: {
'Authorization': 'Bearer ' + token,
'Content-Type': 'application/json'
},
json: true,
body: jsonBody,
resolveWithFullResponse: true,
simple: false
};
// --- API call using promise-----
rp(optionsForCreatingcalendar)
.then(function(response) {
},function(err){
});
有人可以帮我解决吗?
谢谢在阿达文斯。
感谢上帝,我解决了我的问题。由于日期格式,我无法创建事件。
工作规范:
var jsonBody = {
"Subject": "test event",
"Body": {
"ContentType": "HTML",
"Content": "sadsad"
},
"Start": {
"DateTime": "2016-05-21T10:10:00",
"TimeZone":"India Standard Time"
},
"End": {
"DateTime":"2016-05-21T11:10:00",
"TimeZone":"India Standard Time"
},
"Attendees": result,
"Type":"Occurrence",
"Recurrence": {
"Pattern": {
"DayOfMonth": 0,
"Month": 0,
"Type": "Daily",
"Interval": 3,
"FirstDayOfWeek": "Sunday"
},
"Range": {
"StartDate": "2016-05-27",
"EndDate": "2016-06-27",
"NumberOfOccurrences": 0,
"Type": "NoEnd"
}
}
};
谢谢大家。
相关文章:
- JavaScript打印功能使日历停止工作
- 如何在输入字段中的按钮的帮助下打开日历,该字段的类型为“=”;日期”;
- primefaces日历可以禁用过去的日期和时间吗
- Google 脚本:用于创建日历活动的脚本运行时不会出错,但不会执行任何操作
- 如何在谷歌日历图表中使用布尔型列
- Json在完整日历中对数据进行了编码
- 将到达日历中的2天添加到离开日历中
- 如何在下拉列表中选择完整的日历月份和年份
- 谷歌公共日历链接没有'不工作(完整日历)
- 使用AJAX将日期从SQL服务器传递到jQuery日历
- 为网站表单创建一个专业的日历
- 如何在完整日历中的当天点击时显示活动详细信息
- 如何使用角度材质日历
- jQuery完整日历添加事件,仅包含月份和日期
- 正在将outlook日历嵌入网页
- 使用 Node.js 创建定期 Outlook 日历事件
- 如何在我的 Web 应用程序中检索和显示 Outlook/Exchange 日历事件
- 日历与Outlook类似的功能
- 如何从电子邮件链接或网页打开Outlook日历
- Office 2013应用程序:如果outlook项目位于共享日历中,则无法在该项目中加载自定义属性