我想仅从Microsoft Graph / Outlook端点获取属于电子邮件的特定类别。但是给了我相关电子邮件中存在的所有类别。
[https://graph.microsoft.com/beta/me/outlook/masterCategories/?$ filter = displayName eq'红色类别']
以上链接是我对Microsoft Graph API的查询,我得到以下结果
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#users('1e69674d-b0b3-404e-ae2d-a758569ce83c')/outlook/masterCategories",
"value": [
{
"id": "347a7dcc-6c61-4c93-85a5-eb75f973a77f",
"displayName": "Red category",
"color": "preset0"
},
{
"id": "643d45c3-aecb-4fbb-8254-c2520f01cf20",
"displayName": "Orange category",
"color": "preset1"
},
{
"id": "d06a692a-9406-4052-9b1e-bc7ae293a4e4",
"displayName": "Yellow category",
"color": "preset3"
},
{
"id": "8c3e842d-427f-4480-8459-e3e4e785fa85",
"displayName": "Green category",
"color": "preset4"
},
{
"id": "11502440-1912-4de1-afad-c2209178219d",
"displayName": "Blue category",
"color": "preset7"
},
{
"id": "f3f1b1ca-b319-4951-9eeb-954a169e3d71",
"displayName": "Purple category",
"color": "preset8"
},
{
"id": "1fc2506b-2676-447c-bfa3-44a3a7a2dc2d",
"displayName": "Important",
"color": "preset14"
},
{
"id": "8926f11d-23ba-4804-ace7-8ae349f390a6",
"displayName": "Caution",
"color": "preset16"
},
{
"id": "60434e45-effa-40d7-b753-705d59ef3440",
"displayName": "Star",
"color": "preset2"
}
]
}
通过 displayName ?
等属性过滤类别的任何方法答案 0 :(得分:0)
根据官方指南,它支持{id}过滤。
https://graph.microsoft.com/beta/me/outlook/masterCategories/8cefb2b7-8f81-47e3-b6d3-a8e2dd4ac42a
https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/outlookcategory_get
答案 1 :(得分:0)
/ me /通常不会很好地为我返回过滤器。
尝试致电
/ users / {id} / outlook / masterCategories?filter = displayName eq'红色类别'