1

I am running into an issue creating recurring events in the past using Graph API. When I POST this data to /me/calendars/[calendarId]/events I get an ErrorPropertyValidationFailure error:

{
  "isAllDay": true,
  "start": {
    "timeZone": "America/New_York",
    "dateTime": "2000-09-02"
  },
  "end": {
    "timeZone": "America/New_York",
    "dateTime": "2000-09-03"
  },
  "subject": "Jimmy's birthday",
  "body": { "contentType": "text", "content": "" },
  "isCancelled": false,
  "recurrence": {
    "pattern": {
      "type": "absoluteYearly",
      "interval": 1,
      "dayOfMonth": 2,
      "month": 9
    },
    "range": { "startDate": "2000-09-02", "type": "noEnd" }
  },
  "showAs": "free",
  "type": "seriesMaster"
}

All of the data seems valid to me, and indeed just changing the start and end dateTime values and the recurrence range's startDate to be in 2019 instead of 2000, and it seems to work.

But here's where it gets weird: keep those values in 2000, and change the dayOfMonth in the recurrence pattern to an incorrect value, like 5. Then when submitting to the API, it works! The recurrence will instead appear to begin on Sep 5 of 2000 and there is nothing on Sep 2 (also, the event seems to run "Tue 9/5/2000, 11:00 PM to Wed 9/6/2000, 11:00 PM" on the calendar, which is strange, since it also appears as an all-day event).

So my question is: is this a bug? Or what the heck's happening? It looks like correct data is getting a validation error, but incorrect data creates an event.

Updating to add the error body:

{
  "error": {
    "code": "ErrorPropertyValidationFailure",
    "message": "At least one property failed validation.",
    "innerError": {
      "date": "2020-10-15T22:48:50",
      "request-id": "c08b1d73-5b6d-46ac-8751-d1f17310f652",
      "client-request-id": "c08b1d73-5b6d-46ac-8751-d1f17310f652"
    }
  }
}
  • Could you please tell us why you want to create events in the past? – Shiva Keshav Varma Sep 28 '20 at 16:25
  • @Shiva-MSFTIdentity Generally wouldn't, but it's for a calendar sync, and many Outlook users seem to have birthday events as annual recurring events starting on a person's actual date of birth, e.g. in 1954 or whenever. So if they were to change to their sync to point at a new and blank Outlook calendar, we want to create similar events to make sure the calendars match up. Is there a limit on when events can be created in the past? I didn't see anything in the API documentation, and the error message doesn't give any info at all beyond `ErrorPropertyValidationFailure` – Mitch Eagles Oct 01 '20 at 16:46
  • The errorcode tells that one of the property validation failed (from the payload). So my question is, whether the above given payload (with year 2000) always fail or worked anytime? What happens if you try resubmit? Still you see the same error? – Dev Oct 08 '20 at 14:43
  • @Dev It always fails when I've tried, but when I change a part of `recurrence` to have incorrect info (like changing the `dayOfMonth` to be something other than 2) then it succeeds without error. – Mitch Eagles Oct 12 '20 at 14:10
  • ok cool... can you please share the detailed error response (with correlationid/request id & timestamp) for the above request... – Dev Oct 15 '20 at 16:07
  • @Dev Thanks, just added one to the original post for a similar request, event starting in 2002 – Mitch Eagles Oct 15 '20 at 22:53
  • Cool, let me look into that... – Dev Oct 22 '20 at 17:11

0 Answers0