php - Microsoft Outlook 日历 API 中的 ErrorOccurrenceTimeSpanTooBig?
问题描述
我正在尝试将日历 Outlook API 集成到 laravel 中。
我能够创建简单的事件,但是当我尝试创建重复事件时,我得到了以下响应:
"error": {
"code": "ErrorOccurrenceTimeSpanTooBig",
"message": "One occurrence of the recurring calendar (truncated...)
这是我传递给的有效负载json_encode
:
array(6) {
["subject"]=>
string(15) "recurring title"
["body"]=>
array(1) {
["content"]=>
string(0) ""
}
["start"]=>
array(2) {
["dateTime"]=>
string(19) "2019-07-28 12:00:00"
["timeZone"]=>
string(11) "Asia/Taipei"
}
["end"]=>
array(2) {
["dateTime"]=>
string(19) "2019-08-05 12:00:00"
["timeZone"]=>
string(11) "Asia/Taipei"
}
["location"]=>
array(1) {
["displayName"]=>
string(18) "location recurring"
}
["recurrence"]=>
array(2) {
["pattern"]=>
array(3) {
["type"]=>
string(6) "weekly"
["interval"]=>
int(1)
["daysOfWeek"]=>
array(1) {
[0]=>
string(6) "Monday"
}
}
["range"]=>
array(3) {
["type"]=>
string(7) "endDate"
["startDate"]=>
string(10) "2019-07-28"
["endDate"]=>
string(10) "2019-10-10"
}
}
}
然后我在这里传递:
$createCalendarEventUrl = '/me/calendar/events';
$graph = new Graph();
$graph->setAccessToken($this->TokenCacheService->getAccessToken($request));
$newCalendarEvent = $graph->createRequest('POST', $createCalendarEventUrl)
->attachBody(json_encode($newEvent))
->execute();
我在 Microsoft 的 Docs 中找到了它,但我仍然不清楚如何修复它。
解决方案
我很确定您收到错误的原因是因为和之间的差异2019-07-28 12:00:00
是2019-08-05 12:00:00
8 天,并且您要求 Outlook 每周重复该事件。
您可以尝试将其设置为<= 7 days
吗?
推荐阅读
- html - 在网站上按tab后,如何获取html焦点元素的背景和边框颜色?
- java - Java正则表达式解析字符串的中间值
- amazon-web-services - 在 AWS 上重新安装 conda_python2 / conda_python3 内核
- python - 创建值是列表的字典
- java - Java 按最大值排序HashMap,然后是最低键
- machine-learning - 计算负 ELBO
- android - Android:是否可以在通话期间让应用程序与来电者通话?
- c++ - OnComponentBeginOverlap.AddDynamic 说没有函数模板的实例与参数列表匹配?
- python - 无法在 Gitbash 上的 virtualenv 中运行服务器“无法导入 Django。您确定它已安装并且
- powerbi - 我可以在我工作的组织中安装 Power BI 报表服务器的开发人员版并在本地环境中创建门户吗?