Use filter to list customer bookings appointments for a specific customer and staff member - invalid filter clause

Lotfi Haddouche 20 Reputation points
2023-04-10T11:05:27.6866667+00:00

I'm trying to filter the listed appointments for specific staff members and specific customers, I tried different filter queries but I always get "invalid filter clause" error message, I tried using any() and contains, here are some examples of the json and filters used:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#solutions/bookingBusinesses('Test%40test.com')/appointments",
    "value": [
        {
            "id": "AAMkADY4NTViYjRhLTljM2QtNGU1dza",
            "selfServiceAppointmentId": "a50BjX0ZqEyykpRLdze4Q2",
            "additionalInformation": "",
            "isLocationOnline": false,
            "joinWebUrl": "",
            "customerTimeZone": "",
            "serviceId": "f8bfa875-43b3-dzee-8407-adc611c88fe3",
            "serviceName": "Office hours",
            "duration": "PT30M",
            "preBuffer": "PT0S",
            "postBuffer": "PT0S",
            "priceType": "undefined",
            "price": 0.0,
            "serviceNotes": "This is where you can add notes about this service that only you and your staff see.",
            "optOutOfCustomerEmail": false,
            "staffMemberIds": [
                "b5e868fe-azxv-deze-b10c-eb24eee79fc1"
            ],
            "smsNotificationsEnabled": false,
            "anonymousJoinWebUrl": null,
            "maximumAttendeesCount": 1,
            "filledAttendeesCount": 1,
            "startDateTime": {
                "dateTime": "2023-04-10T15:00:00.0000000",
                "timeZone": "UTC"
            },
            "endDateTime": {
                "dateTime": "2023-04-10T15:30:00.0000000",
                "timeZone": "UTC"
            },
            "serviceLocation": {
                "displayName": "",
                "locationEmailAddress": "",
                "locationUri": "",
                "locationType": "default",
                "uniqueId": null,
                "uniqueIdType": null,
                "address": {
                    "street": "",
                    "city": "",
                    "state": "",
                    "countryOrRegion": "",
                    "postalCode": ""
                },
                "coordinates": {
                    "altitude": 0.0,
                    "latitude": 0.0,
                    "longitude": 0.0,
                    "accuracy": 0.0,
                    "altitudeAccuracy": 0.0
                }
            },
            "reminders": [],
            "customers": [
                {
                    "@odata.type": "#microsoft.graph.bookingCustomerInformation",
                    "customerId": "14e5fbbe-09d5-eecb-9acd-3f70403fe9f7",
                    "name": "Test test",
                    "emailAddress": "test@test.com",
                    "phone": "",
                    "timeZone": "",
                    "notes": "",
                    "location": null,
                    "customQuestionAnswers": []
                }
            ]
        }
    ]
}
?$filter=staffMemberIds/any(s:s eq 'b5e868fe-azxv-deze-b10c-eb24eee79fc1')
?$filter=customers/any(c:c/emailAddress eq 'test@test.com')
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,445 questions
0 comments No comments
{count} votes

Accepted answer
  1. Gopinath Chennamadhavuni 2,431 Reputation points
    2023-04-10T12:52:27.7933333+00:00

    Hi @Lotfi Haddouche,

    Thanks for reaching out.

    As per the documentation: v1.0 bookingbusiness-list-appointments, currently list appointments Graph API supports only the $count and $expand OData query parameters to help customize the response. Please refer the document for more details: https://learn.microsoft.com/en-us/graph/api/bookingbusiness-list-appointments?view=graph-rest-1.0#optional-query-parameters.

    You can submit a feature request from graph feedback portal, which will be monitored by Microsoft Graph Product Engineering team and based on votes received for the feature request it will be taken up by engineering team.

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

0 additional answers

Sort by: Most helpful