MS Graph组API:RESPEST_RESOURCENOTFOUND仅在ID上过滤时

发布于 2025-02-13 00:47:59 字数 269 浏览 0 评论 0原文

当我将此查询发送到图形时:

https://graph.microsoft.com/v1.0/groups?$filter=id eq '8bd1ac2d-7cbf-4316-8f5d-0819179f4cff'

并且该组存在,我将获得一个带有1组的数组。

但是与不存在的ID相同的查询,我会收到此错误:request_resourcenotfound 我怎么没有空数阵列? 我应该如何测试该组是否存在而不会遇到错误?我在电力自动化工作。 谢谢,

When I send this query to Graph:

https://graph.microsoft.com/v1.0/groups?$filter=id eq '8bd1ac2d-7cbf-4316-8f5d-0819179f4cff'

And the group exists, I get an array with 1 group.

But the same query with an id that does not exist, I get this error : Request_ResourceNotFound
How come I don't get an empty array ?
How should I test if the group exists without getting an error ? I work in Power Automates.
Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柒七 2025-02-20 00:47:59

如果不存在组ID,则无法获得图API的结果。

它始终返回 request_resourcenotfound。”资源'xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxxx'不存在或存在其查询的参考 - 普罗伯特对象之一,而不是存在

图API获取组列表。
然后比较列表中的组ID。

There is no way to get the empty array as the result of graph API if the group id is not exist.

Its always return the Request_ResourceNotFound."Resource 'xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' does not exist or one of its queried reference-property objects are not present.",

For workaround you can use the List groups graph API to get the list of groups.
And then compare the group id in the list.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文