Forum Discussion
Henry_888
Sep 15, 2023Copper Contributor
MS Bookings API - Can't create staff member using MS Bookings API
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
- AnthonyLPBrass Contributor
it's pretty old but the endpoint given by ;icrosoft was not working for me with power automate.
but if you use this endpoint it's works
https://graph.microsoft.com/beta/bookingBusinesses/id/staffMembers
- ved-leachimBrass Contributor
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.- ved-leachimBrass Contributor
A minimal valid request would look like that:
{"@odata.type": "#microsoft.graph.bookingStaffMember","displayName": "Hans Muster","emailAddress": "email address removed for privacy reasons","role": "administrator"}
- ved-leachimBrass Contributor
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.