Is the Bookings API the wrong approach for booking a single meeting with a team member?

Breakfast 1 Reputation point
2022-10-31T17:11:37.573+00:00

My goal is to be able to create an appointment through which a user can request to speak with a member of our team at a specific time, and that appointment is created as a Teams meeting, added to the team member's calendar and the invite sent to the requesting user.

My assumption was that the Bookings API would be a good way to do this, using the solutions/bookingBusinesses/myBookingType@my.organisation/appointments endpoint. As the users could come from anywhere, it needed to have Application permissions and those were granted for Bookings.Read.All and BookingsAppointment.ReadWrite and then trying to create an appointment as described in the documentation here.

My problem is that every call I make- example being:

POST https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/myBookingType@myOrganisation/appointments  
  
Accept: application/json  
Authorization: Bearer  abcdefghi...xyz  
Content-Type: application/json  
  
{   "duration":"PT30M",  "start_date_time":"2022-12-29T14:30:00+00:00", "staffMemberIds":["abcd-efgh-ijkl-mnop"], "isLocationOnline":true, "filedAttendeeCount":1, "reminders":[{"message":"Remember your appointment today", "offset":"PT120M", "recipients":"allAttendees"}], "customers": [{"name":"Custo Mer ", "emailAddress":"customer-email@organisation.com" }]}  

Is coming back with a 401 response, no error code but the message "Authorization has been denied for this request." and a couple of ids in the inner error message which trace through to a successful sign-in with no more information.

Now, I can't tell what is going on here, I'm in pure guesswork territory. Other answers seem to suggest that the only people who can create an appointment are users who are signed in creating the appointment for themselves, which seems like a completely backwards way to approach this and I think the application delegated permissions should circumvent it. However it does appear as though maybe I have to create the customer entity as a bookingCustomerInformation object, before I can use it to create a bookingAppointment - something which seemingly I cannot do through the API with Application permissions.

So my core question is: Is the BookingAppointment the wrong approach to use if I want to book an appointment with one of the team? Should I be manually inserting an event into their calendar or something along those lines, instead?

Microsoft Graph Customer Booking API
Microsoft Graph Customer Booking API
A Microsoft API that lets enterprise organization and small business owners manage customer bookings and information with minimal setup.
197 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bhanu Kiran 3,511 Reputation points
    2022-10-31T22:16:03.12+00:00

    Hi @Breakfast ,

    As per the documentation, If you create a custom app using application permissions, you must follow the Business rules validation.

    255845-create-appointment.png

    Please ensure and validate that you are following the Business rules validation to overcome this issue.

    Hope this helps.

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

    1 person found this answer helpful.