简体   繁体   English

Microsoft Graph API:按位置过滤日历事件

[英]Microsoft Graph API: Filter Calendar Events by Location

I'm trying to filter all events by a location displayName.我正在尝试按位置 displayName 过滤所有事件。 Since location is a complex property and displayName is nested, I need help on how to do this.由于 location 是一个复杂的属性并且 displayName 是嵌套的,因此我需要有关如何执行此操作的帮助。 I've tried the following but neither work.我尝试了以下但都没有工作。

https://graph.microsoft.com/v1.0/me/events?$expand=location($filter=displayName eq 'East Conference Room') https://graph.microsoft.com/v1.0/me/events?$expand=location($filter=displayName eq '东会议室')

https://graph.microsoft.com/v1.0/me/events?$filter=location/displayName/'East Conference Room' https://graph.microsoft.com/v1.0/me/events?$filter=location/displayName/'东会议室'

You can achieve what you want by using the $filter parameter in the api.您可以通过使用 api 中的 $filter 参数来实现您想要的。

Use query parameters to customize responses 使用查询参数自定义响应

I worked out your example by adapting the emails example in the documentation, which also filters by a nested parameter and compares to a string.我通过改编文档中的电子邮件示例来制定您的示例,该示例还通过嵌套参数过滤并与字符串进行比较。

Get all emails from a specific address received by the signed-in user.获取登录用户收到的来自特定地址的所有电子邮件。 https://graph.microsoft.com/v1.0/me/messages?$filter=from/emailAddress/address eq 'someuser@example.com' https://graph.microsoft.com/v1.0/me/messages?$filter=from/emailAddress/address eq 'someuser@example.com'

Therefore, for your use case, ie to only get calendar events with a location displayName equal to "East Conference Room", it would be:因此,对于您的用例,即仅获取位置 displayName 等于“East Conference Room”的日历事件,它将是:

https://graph.microsoft.com/v1.0/me/events?$filter=location/displayName eq 'East Conference Room'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Microsoft Graph API:如何使用 API 访问来宾日历事件? - Microsoft Graph API: How to access guest calendar events using API? 使用microsoft graph api获取sharepoint日历事件的重复数据? - Get recurrence data of sharepoint calendar events using microsoft graph api? Microsoft Graph API 在 Outlook 日历上,无需检查内部私人事件 - Microsoft Graph API on Outlook calendar without checking inside private events 如何使用 Microsoft Graph API 和 java 为用户获取日历事件 - How to fetch calendar events for a user using Microsoft Graph API with java 我可以使用 Microsoft Graph API 同步日历事件吗? - Can I sync calendar events with the Microsoft Graph API? Microsoft Graph API 在时间间隔内获取日历更改,按 lastModifiedDateTime 过滤 - Microsoft Graph API get calendar changes in a time interval, filter by lastModifiedDateTime Microsoft Graph API:由 API 创建的组日历事件不会发送给用户日历 - Microsoft Graph API: Group Calendar Events created by API are not sent to users Calendar Microsoft Graph:作为管理员,在用户日历中创建事件 - Microsoft Graph: as Admin, create events in user calendar 使用 Microsoft.Graph 获取共享日历事件 - Getting shared calendar events with Microsoft.Graph Microsoft Graph API 不返回日历事件 - Microsoft Graph APIs not returning Calendar Events
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM