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

568 Views Asked by At

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

There are 2 best solutions below

3
user2250152 On

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();
0
deadsystem On

This a known Graph API bug, until it is resolved, I using listview to find all appointments, and getting appointments one by one using the /appointments/AAMkADQ0YTdhYWQAAA= endpoint using the Ids from listview.

Example:

GET https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/[email protected]/appointments/AAMkADKnAAA=

This way the customer field always shows up, if there are regarding customers for a given appointment. Source