Ignore item thats being edited

0
Hi all I’m trying to let users book a room and write that meeting in their office calendar with microsoft graph api. I want to make sure that times can not overlap eachother for the same room. This works when creating a meeting just as I want it, however when I want to edit that meeting (with a PATCH request), I am faced with the problem that the meeting itself acts as a blocker for that original time window (e.g when I just want to change the description but time stays the same). Because I am retrieveing events from that time window to check if there is a scheduled item in it (with POST https://graph.microsoft.com/beta/me/calendar/getSchedule + the times), It fails since there is still the item there, in that time window that gets checked, that I want to edit. Is there a workaround to this or does anyone have an idea how to solve this?   Thanks
asked
2 answers
0

Hi Lenny,

 

Can you clarify if you are calling the Update Event API while trying to perform an Edit instead of Create Event API? Cause if you are calling the latter then it wont allow you to Create a new event over existing event, advise to call the Update Event.

 

Alternatively you can retain the existing event details within mendix and do a Delete Event call and then perform a Create event call, incase the user clicks on cancel, call the Create event call with the retained event data in mendix. Hope this helps.

Request Body for Update event,

 

PATCH https://graph.microsoft.com/v1.0/me/events/{id}
Content-type: application/json
Content-length: 285

{
  "originalStartTimeZone": "originalStartTimeZone-value",
  "originalEndTimeZone": "originalEndTimeZone-value",
  "responseStatus": {
    "response": "",
    "time": "datetime-value"
  },
  "recurrence": null,
  "iCalUId": "iCalUId-value",
  "reminderMinutesBeforeStart": 99,
  "isOnlineMeeting": true,
  "onlineMeetingProvider": "teamsForBusiness",
  "isReminderOn": true,
  "hideAttendees": false,
  "categories": ["Red category"]
}

 

Thanks

answered
0

Hi @Abhishek

 

This is the documentation (https://docs.microsoft.com/en-us/graph/api/event-update?view=graph-rest-1.0&tabs=http)

This is my PATCH request:(https://graph.microsoft.com/v1.0/me/events/{the event id}) with request body:

{{
  "subject": "{1}", (= description)

  "start": {{
      "dateTime": "{2}",
      "timeZone": "Central European Standard Time"
  },
  "end": {{
      "dateTime": "{3}",
      "timeZone": "Central European Standard Time"
  },
  "location":{{
      "displayName":"{4}",
    "locationEmailAddress":"{5}"
},
  
  "showAs": "busy",

  {6} (= attendees)

  ],
  
  "allowNewTimeProposals": true
}

This is the same request body as the POST call to create an event just with different data since I want it to be updated.

answered