Sep 15 2023 01:08 AM
Hi
I'm following this tutorial to use MS Bookings API ( https://learn.microsoft.com/en-us/graph/api/resources/booking-api-overview?view=graph-rest-1.0 )
but I'm stuck in "Add individual staff members for the business" step, the API response is
here's my sample request :
{
"displayName":"Test",
"emailAddress": "email address removed for privacy reasons",
"role": "externalGuest"
}
and I always got this error response even that I've provided name and email address
{
"error": {
"code": "ErrorInvalidOperation",
"message": "Cannot create a booking staff without name and email.",
"innerError": {
"date": "2023-09-13T09:27:52",
"request-id": "5f90921e-1d45-42c4-ab96-78ff5b6a958b",
"client-request-id": "5f90921e-1d45-42c4-ab96-78ff5b6a958b"
}
}
}
anyone experience the same issue ?
is there any rules on which email address that can be used as staff member ?
Regards,
Henry
Nov 08 2023 03:05 AM - edited Nov 08 2023 04:39 AM
I have exactly the same problem. I have already created several new BookingBusiness calendars and tried them with different e-mail addresses (internal and external), but it just doesn't seem to work.
A cross comparison with a calendar created via the GUI has shown that the same fields with the same content work via the GUI, but not via the API.
I would appreciate feedback from Microsoft on this issue.
Nov 09 2023 08:53 AM - edited Nov 14 2023 02:26 AM
Hi Henry
I had a call with a member of the Microsoft Graph Team, she could reproduce the issue and it will be escalated within the Graph Team. It looks like the documentation is wrong and needs to be changed.
The request for the endpoint staffMembers is not sufficient like it is on the documentation at the moment (9.11.23):
POST https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/{id}/staffMembers
Authorization: Bearer {access token}
Content-Type: application/json
{
"displayName":"Dana Swope",
"emailAddress": "email address removed for privacy reasons",
"role": "externalGuest"
}
This will result in the following error response:
{
"error": {
"code": "ErrorInvalidOperation",
"message": "Cannot create a booking staff without name and email.",
"innerError": {
"date": "2023-11-09T16:05:42",
"request-id": "fef2d375-6ff7-4b58-892d-92e7560b98fe",
"client-request-id": "fef2d375-6ff7-4b58-892d-92e7560b98fe"
}
}
}
To workaround this problem you can use the longer Request from the documentation here.
Nov 14 2023 02:25 AM - edited Nov 14 2023 02:26 AM
A minimal valid request would look like that: