按类别过滤 Microsoft Graph API 中的日历视图请求

问题描述 投票:0回答:1

我需要从 Graph API 事件中获取没有任何类别或没有特定类别的事件 所以,当我发送时:

https://graph.microsoft.com/v1.0/me/calendarView?startDateTime=2024-01-05T12:32:50.095Z&endDateTime=2024-01-31T12:32:50.095Z&$filter=not (categories/any(x:x eq 'MySyncJob'))

我收到回复了

{
    "error": {
        "code": "ErrorInternalServerError",
        "message": "An internal server error occurred. The operation failed."
    }
}

但是要求:

https://graph.microsoft.com/v1.0/me/calendarView?startDateTime=2024-01-05T12:32:50.095Z&endDateTime=2024-01-31T12:32:50.095Z&$filter=categories/any(x:x eq 'MySyncJob')

https://graph.microsoft.com/v1.0/me/calendarView?startDateTime=2024-01-05T12:32:50.095Z&endDateTime=2024-01-31T12:32:50.095Z&$filter=categories/any(x:x ne 'MySyncJob')

工作良好...

我做错了什么?

api events graph categories
1个回答
0
投票

您可以尝试以下方法看看是否有效。

从这个资源找到这个

https://graph.microsoft.com/v1.0/me/calendarView?startDateTime=2024-01-05T12:32:50.095Z&endDateTime=2024-01-31T12:32:50.095Z&$filter=NOT(categories/any(x:x eq 'MySyncJob'))
© www.soinside.com 2019 - 2024. All rights reserved.