gpt4 book ai didi

microsoft-graph-calendar - 创建重复事件的 Microsoft Graph API 返回 500

转载 作者:行者123 更新时间:2023-12-05 05:06:00 25 4
gpt4 key购买 nike

我正在编写一个使用 Microsoft Graph API v1.0 与 Office365 事件同步的应用程序.

创建单个事件时,事件按预期创建:

Response Status Code: 201 Created
Request URL: https://graph.microsoft.com/v1.0/me/calendars/<myCalendarId>/events
Request Method: POST
Request Payload:
{
"subject": "single event",
"start": {
"dateTime": "2020-02-15T09:00:00",
"timeZone": "Europe/Berlin"
},
"end": {
"dateTime": "2020-02-15T10:00:00",
"timeZone": "Europe/Berlin"
},
"attendees": [],
"type": "singleInstance",
"location": {
"displayName": null
},
"recurrence": null
}

但是,如果我为重复发生的事件发送创建请求,我会收到错误响应。

Response Status Code: 500 Internal Server Error
Request URL: https://graph.microsoft.com/v1.0/me/calendars/<myCalendarId>/events
Request Method: POST
Request Payload:
{
"subject": "test recurring event",
"start": {
"dateTime": "2020-02-14T09:00:00",
"timeZone": "Europe/Berlin"
},
"end": {
"dateTime": "2020-02-14T10:00:00",
"timeZone": "Europe/Berlin"
},
"attendees": [],
"location": {
"displayName": null
},
"recurrence": {
"pattern": {
"daysOfWeek": [],
"type": "daily"
},
"range": {
"numberOfOccurrences": "2",
"recurrenceTimeZone": "Europe/Berlin",
"startDate": "2020-02-14",
"type": "numbered"
}
}
}
Response Body:
{
"error": {
"code": "ErrorInternalServerError",
"message": "An internal server error occurred. The operation failed.",
"innerError": {
"request-id": "2d97931c-e08c-45a8-8167-5849df53a694",
"date": "2020-02-14T14:38:28"
}
}
}

我发现添加重复设置会导致 Internal Server Error 很奇怪。如何使用 API 创建周期性事件?

最佳答案

如果您想创建一个每天发生的重复事件,而不是按以下方式设置模式:

    "pattern": {
"daysOfWeek": [],
"type": "daily"
},

请这样设置模式:

"pattern": {
"type": "daily",
"interval": 1
},

描述了创建每日重复模式 here在概念文档中。隔天之内,还会有一个REST example在引用文档中。

关于microsoft-graph-calendar - 创建重复事件的 Microsoft Graph API 返回 500,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60228248/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com