MS Bookings API Error - POST /solutions/bookingBusinesses/{id}/appointments

Tuukka Tihekari 35 Reputation points
2023-03-27T12:16:39.1566667+00:00

Hello,

I am writing to seek assistance with an issue I encountered while using the MS Bookings API. Until this point, the API has worked without issues and I have not made any modifications to my application. When I tried to make a POST request to create an appointment using the API endpoint /solutions/bookingBusinesses/{id}/appointments, I received an internal server error with the following details:

  • Status Code: 500
  • Error Code: InternalServerError
  • Request ID: 13a8d01b-36be-42c0-8ea8-1891af0ad9ee
  • Date: 2023-03-27T07:03:22.000Z
  • Message: "An internal server error occurred. The operation failed., Unable to cast object of type 'System.Collections.Generic.List1[Microsoft.Exchange.Data.StoreObjects.StorePropertyDefinition]' to type'System.Collections.Generic.ICollection1[Microsoft.Exchange.Data.PropertyDefinition]'."

I have already tried to troubleshoot the issue by reviewing the API documentation and making sure that all required parameters are included in the request, but the error persists. I suspect that there might be an issue with the API itself or the documentation is missing some details.

Could you please investigate this issue and provide me with a resolution? If there is any additional information you need from me, please let me know and I will be happy to provide it.

Thank you for your assistance, Tuukka

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,777 questions
{count} votes

Accepted answer
  1. Shivam Dhiman 6,046 Reputation points
    2023-03-27T16:35:26.8066667+00:00

    Hi @Tuukka Tihekari

    I am able to replicate the same when I am using Customer-Id in body while creating appointment.
    So as a workaround, I will suggest you to use Body without Customer-id.
    Please refer to the below sample screenshot:Booking1

    Sample Body:

    {
        "@odata.type": "#microsoft.graph.bookingAppointment",
        "endDateTime": {
            "@odata.type": "#microsoft.graph.dateTimeTimeZone",
            "dateTime": "2023-04-04T16:30:00.0000000",
            "timeZone": "UTC"
        },
        "serviceId": "service-id",
        "staffMemberIds": [
            "Staff-member-id"
        ],
        "startDateTime": {
            "@odata.type": "#microsoft.graph.dateTimeTimeZone",
            "dateTime": "2023-04-04T16:00:00.0000000",
            "timeZone": "UTC"
        },
    
       customers@odata.type: "#Collection(microsoft.graph.bookingCustomerInformation)",
        "customers": [
            {
                "@odata.type": "#microsoft.graph.bookingCustomerInformation",
                "name": "Jordan Miller",
                "emailAddress": jordanm@****.com
            }
        ]
    }
    

    Also, I would recommend you to raise a support case with Microsoft Graph, a Support Engineer will be able to assist you better. You can raise support ticket from
    http://aad.portal.azure.com/ or https://admin.microsoft.com/#/support/requests.

    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.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

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.