我能够通过将 JSON 请求发布到https://graph.microsoft.com/v1.0/me/calendar/events https://graph.microsoft.com/v1.0/me/calendar/events。我已经有一段时间没看它了,但现在当我这样做时,我收到了 400(错误的请求)。
对于范围,我指定了“openidoffline_accessUser.ReadCalendars.ReadWriteContacts.ReadMail.Send”(我所做的不仅仅是创建日历事件)。
我已通过身份验证,并且可以在发帖时成功创建电子邮件https://graph.microsoft.com/v1.0/me/sendmail https://graph.microsoft.com/v1.0/me/sendmail。
我尝试将网址更改为https://graph.microsoft.com/v1.0/me/events https://graph.microsoft.com/v1.0/me/events创建事件,但仍然得到 400。
我发送的请求基本上如下所示:
{
"@odata.etag":null,"attendees":
[
{
"emailAddress":
{
"address":"[email protected] /cdn-cgi/l/email-protection",
"name":"reafirstname reallastname"
},
"status":null,
"type":"Required"
}
],
"body":
{
"content":"simplified test",
"contentType":"Text"
},
"bodyPreview":null,
"categories":null,
"changeKey":null,
"createdDateTime":null,
"end":
{
"dateTime":"2017-03-12T17:30:00.0000000",
"timeZone":"UTC"
},
"hasAttachments":false,
"iCalUId":null,
"id":null,
"importance":null,
"isAllDay":false,
"isCancelled":false,
"isOrganizer":false,
"isReminderOn":false,
"lastModifiedDateTime":null,
"location":null,
"onlineMeetingUrl":null,
"organizer":
{
"emailAddress":
{
"address":"[email protected] /cdn-cgi/l/email-protection",
"name":"reafirstname reallastname"
}
},
"originalEndTimeZone":null,
"originalStart":null,
"originalStartTimeZone":null,
"recurrence":null,
"reminderMinutesBeforeStart":0,
"responseRequested":false,
"responseStatus":null,
"sensitivity":null,
"seriesMasterId":null,
"showAs":null,
"start":
{
"dateTime":"2017-03-12T17:00:00.0000000",
"timeZone":"UTC"
},
"subject":"Test Event created from API",
"type":"singleInstance",
"webLink":null
}
我只能猜测我现在缺少一些以前没有的必需参数。
有什么想法为什么会返回 400 吗?