2

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?

deadsystem
  • 27
  • 5

2 Answers2

1

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();
user2250152
  • 14,658
  • 4
  • 33
  • 57
  • 1
    I tried this, but if .Select("customers") applied, than Graph API returns only empty attributes. I tried with "Customers" as well. Maybe I should raise a bug ticket. – deadsystem Jan 31 '22 at 13:15
  • @deadsystem If "select" is used you need to specify all properties. Otherwise those properties will be null/empty. – user2250152 Jan 31 '22 at 13:45
  • 1
    I understand, but it not returns the customers, even when select them. – deadsystem Jan 31 '22 at 15:26
0

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/Contosolunchdelivery@contoso.onmicrosoft.com/appointments/AAMkADKnAAA=

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

deadsystem
  • 27
  • 5