Updating bookingstaffmember microsoft.graph.bookingWorkTimeSlot object error

Tonti 20 Reputation points
2023-03-07T08:02:05.6666667+00:00

When trying to update the working hours of a staff member in a Bookings calendar this way:

https://graph.microsoft.com/beta/bookingBusinesses/MyCalendarId/staffmembers/MyStaffId

It is returning the following error:

code: "InvalidModel"

message: "changes: The property 'endTime' does not exist on type 'microsoft.bookings.api.bookingWorkTimeSlot'. Make sure to only use property names that are defined by the type."

This is the object I am sending:

{
"@odata.type":"#microsoft.graph.bookingStaffMember",
"workingHours":[
					{"@odata.type":"#microsoft.graph.bookingWorkHours",
					 "******@odata.type":"#microsoft.graph.dayOfWeek",
					  "day":"monday",
					  "******@odata.type":"#Collection(microsoft.graph.bookingWorkTimeSlot)",
					  "timeSlots":[
					  		{
					  		 "@odata.type":"#microsoft.graph.bookingWorkTimeSlot",
					  		 "startTime":"08:00:00.0000000"
							 "endTime":"10:00:00.0000000"							 
							}
						]
					}
				]
}

Any idea what is the problem?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,328 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Tonti 20 Reputation points
    2023-03-07T11:02:17.3+00:00

    The problem is the "@odata.type":"#microsoft.graph.bookingWorkTimeSlot" object is different in the production and beta versions of the api:

    Beta version:

    {
    					  		 "@odata.type":"#microsoft.graph.bookingWorkTimeSlot",
    					  		 "start":"08:00:00.0000000"
    							 "end":"10:00:00.0000000"							 
    							}
    

    Production version:

    	
    {
    					  		 "@odata.type":"#microsoft.graph.bookingWorkTimeSlot",
    					  		 "startTime":"08:00:00.0000000"
    							 "endTime":"10:00:00.0000000"							 
    							}
    
    0 comments No comments

  2. Gopinath Chennamadhavuni 2,436 Reputation points
    2023-03-07T14:17:59.1566667+00:00

    Hi @Tonti

    I'm glad to hear you solve the problem, if you have any issue about MS Graph Booking, you are welcome to raise a ticket in this forum.

    By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others." and according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:

    Updating bookingstaffmember microsoft.graph.bookingWorkTimeSlot object error

    Solution:

    The problem is the "@odata.type":"#microsoft.graph.bookingWorkTimeSlot" object is different in the production and beta versions of the api.

    Beta version:

    {
    					  		 "@odata.type":"#microsoft.graph.bookingWorkTimeSlot",
    					  		 "start":"08:00:00.0000000"
    							 "end":"10:00:00.0000000"							 
    							}
    

    Production version:

    {
    					  		 "@odata.type":"#microsoft.graph.bookingWorkTimeSlot",
    					  		 "startTime":"08:00:00.0000000"
    							 "endTime":"10:00:00.0000000"							 
    							}
    

    You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community members to see the useful information when reading this thread. Thanks for your understanding!

    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.