MS-Graph API,如何使用单一的 "get "API方法调用从一个联系人中获取多个具有不同propertyIds的扩展属性?

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

在测试MS-Graph的联系人时,我尝试使用两个API调用来获取商业传真和公司主电话号码。

商业传真:

https://graph.microsoft.com/v1.0/users/{userId}/contacts?expand=singleValueExtendedProperties($filter=PropertyId eq 'String 0x3A24')

公司主电话号码:

https://graph.microsoft.com/v1.0/users/{userId}/contacts?expand=singleValueExtendedProperties($filter=PropertyId eq 'String 0x3A57')

有没有办法在同一个调用中获取这两个属性?我想让所有扩展属性在office 365联系人视图中可见。类似这样的。

https://graph.microsoft.com/v1.0/users/{userId}/contacts?expand=singleValueExtendedProperties($filter=PropertyId eq 'String 0x3A24') and singleValueExtendedProperties($filter=PropertyId eq 'String 0x3A57')
microsoft-graph
1个回答
1
投票

你应该可以在过滤器内对你的扩展属性进行分组,并使用OR,例如以下对我来说是有效的

https://graph.microsoft.com/v1.0/me/contacts?expand=singleValueExtendedProperties($filter=(PropertyId eq 'String 0x3A24') or (PropertyId eq 'String 0x3A57'))

测试版例子

https://graph.microsoft.com/beta/me/contacts?expand=singleValueExtendedProperties(filter=(id eq 'String 0x3A24') or (id eq 'String 0x3A57'))

0
投票

你可以使用in操作符而不是eq操作符来获取所有id与你提供的列表匹配的属性。

https://graph.microsoft.com/v1.0/users/{userId}/contacts?expand=singleValueExtendedProperties($filter=PropertyId in ('String 0x3A57','String 0x3A24'))
© www.soinside.com 2019 - 2024. All rights reserved.