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

Community Center | Not monitored
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Srinivasa Rao Darna 6,761 Reputation points Microsoft External Staff
    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": ["******@contoso.onmicrosoft.com", "******@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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.