Handle conflict when i create an event which already exist (double books slots)

Pierre acker 6 Reputation points
2022-05-10T14:12:55.607+00:00

I use Microsoft graph on the endpoint me/calendar/events and i would like to have an error when i try to create an event which is already booked. I need to stop the double books slot. I think microsoft graph don't handle this case.

Kind regards,
Pierre ACKER
Web developer

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,562 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Srinivasa Rao Darna 6,711 Reputation points Microsoft Vendor
    2022-05-10T16:47:18.61+00:00

    Hi @Pierre acker ,

    Outlook client/web allows double booking i.e., allows to book/create event more than 1 appointment with same participants at same time, and while booking it will show the availability of the participants as tentative/unavailable but still allows to send invite.

    You can however use calendar-getschedule to know free/busy availability information for a collection of users, distributions lists, or resources (rooms or equipment) for a specified time period.

    POST https://graph.microsoft.com/v1.0/me/calendar/getSchedule   
    Prefer: outlook.timezone="Pacific Standard Time"  
    Content-Type: application/json  
      
    {          
        "schedules": ["adelev@contoso.onmicrosoft.com", "meganb@contoso.onmicrosoft.com"],  
        "startTime": {  
            "dateTime": "2019-03-15T09:00:00",  
            "timeZone": "Pacific Standard Time"  
        },  
        "endTime": {  
            "dateTime": "2019-03-15T18:00:00",  
            "timeZone": "Pacific Standard Time"  
        },  
        "availabilityViewInterval": 60  
    }  
    

    Additional references findmeetingtimes.

    Hope this helps,

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".

    0 comments No comments