使用重复字段创建日历事件失败

Creating calendar events with recurrence field fails

使用重复字段创建日历事件失败。以下是来自 Chrome 网络选项卡的示例请求负载:

成功(无重复字段):

Attendees: []
Body: {ContentType: "HTML", Content: ""}
End: "2015-05-14T16:29:40.307Z"
Start: "2015-05-14T16:29:40.307Z"
Subject: "Regular event"

失败的请求(带有重复字段): Request screenshot

Attendees: []
Body: {
  ContentType: "HTML",
    Content: ""
}
End: "2015-05-14T16:29:40.307Z"
Recurrence: {
  Pattern: {
    DayOfMonth: 0
    FirstDayOfWeek: "Sunday"
    Interval: 1
    Month: 0
    Type: "Daily"
  }
  Range: {
    EndDate: "2015-05-23T00:00:00+03:00"
    NumberOfOccurences: 0
    StartDate: "2015-05-17T00:00:00+03:00"
    Type: "EndDate"
  }
}
Start: "2015-05-14T16:29:40.307Z"
Subject: "Regular event"

在上述情况下,服务器 returns 的错误如下:

"error": {
    "code": "ErrorInvalidRequest",
    "message": "Cannot read the request body."
}

任何人都可以检查上述请求并告诉我重复规则中缺少什么并阻止保存日历事件吗?或者 API 目前不支持创建重复事件?

Url 用于请求: https://outlook.office365.com/api/v1.0/me/events

请求方式:POST

您的 Recurrence 条目似乎缺少换行符“{}”,并且子字段之间没有逗号。由于服务器上的 OData reader 无法解析它,它会抛出 "Can't read the request body" 错误。

尝试:

{
  Attendees: [],
  Body: {
    ContentType: "HTML",
    Content: ""
  },
  End: "2015-05-14T16:29:40.307Z",
  Recurrence: {
    Pattern: {
      DayOfMonth: 0,
      FirstDayOfWeek: "Sunday",
      Interval: 1,
      Month: 0,
      Type: "Daily"
    },
    Range: {
      EndDate: "2015-05-23T00:00:00+03:00",
      NumberOfOccurrences: 0,
      StartDate: "2015-05-17T00:00:00+03:00",
      Type: "EndDate"
    }
  },
  Start: "2015-05-14T16:29:40.307Z",
  Subject: "Regular event"
}