V1 Microsoft Bookings API calendarview always returns empty Customer (bookingCustomerInformation) array

Viewed 258

I used the previous beta Bookings API for getting appointments in a timeframe, the previous structure of bookingappointment just worked there.

Right now I try to update the client to use the production ready v1 API, and all appointments returned by calenderview not containing Customer data. I'm pretty sure those appointments should have customers, there are sent invitation emails to customers regarding the appointment. The /customers endpoint shows all customers.

The issue reproducable by C# SDK and Graph Explorer as well. GraphExplorer

There is a workaround, or what am I missing here?

2 Answers

Looks like a bug in Graph API.

According to the documentation the customers property is optional. Sometimes you have to specify optional property in $select statement.

You can try to add Select() to calendar view request and check whether it will work.

var queryOptions = new List<QueryOption>()
{
    new QueryOption("start", "2022-01-30T00:00:00Z"),
    new QueryOption("end", "2022-01-31T00:00:00Z")
};

var calendarView = await graphClient.Solutions.BookingBusinesses["{id}"].CalendarView
    .Request(queryOptions)
    .Select("customers") // select customers
    .GetAsync();
Related