发送Microsoft Graph请求事件返回400

时间:2017-02-07 13:20:44

标签: rest api microsoft-graph

我可以通过将JSON请求发布到https://graph.microsoft.com/v1.0/me/calendar/events来创建一个包含Graph的事件。我有一段时间没有看过它,但是现在我得到了400(不好的请求)。 对于我已指定“openid offline_access User.Read Calendars.ReadWrite Contacts.Read Mail.Send”的范围(我所做的不仅仅是创建日历事件)。 我已通过身份验证,并且可以在发布到https://graph.microsoft.com/v1.0/me/sendmail时成功创建电子邮件。 我尝试将网址更改为https://graph.microsoft.com/v1.0/me/events以创建活动,但仍然获得400。 我发送的请求基本上是这样的:

{
 "@odata.etag":null,"attendees":
 [
  {
   "emailAddress":
   {  
    "address":"reafirstname.reallastname@realdomain.com",
    "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":"reafirstname.reallastname@realdomain.com",
  "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?

0 个答案:

没有答案