0

当我尝试检索 Office365 组时,我是使用 AngularJS HTTP Get 的成员。我总是在 Chrome 中收到 400 - Bad Request 错误。在 IE 中,我确实得到了结果。

var endpoint = "https://graph.microsoft.com/v1.0/me/memberOf/$/microsoft.graph.group?$filter=groupTypes/any(a:a eq 'unified')";

this.$http.get(endpoint, {
    headers: {
        "Content-Type": "application/json;odata=verbose"
    }
 }).then(function (result) {
     console.log(result);
}, function (error) {
     console.log("error:" + error);
});

看起来 URL 中的引号被替换为 %27 并且 Microsoft Graph/OData 不支持这一点。我会得到以下错误:

Collection open properties are not supported in this release.

Microsoft Graph 中不再提供 JoinedGroups 资源。还有其他方法可以检索到我所属的组吗?还是在 Angular 中有另一种方法可以做到这一点?

4

2 回答 2

0

您可以使用 ListMemberOf 获取组的成员。这是如何调用端点的参考: https ://graph.microsoft.io/docs/api-reference/v1.0/api/group_list_members

您可以使用任何 JS 客户端库来请求 o365 api。您使用的库没有限制,因为您对端点有正确的请求。

您还可以使用图形资源管理器来确保在使用 AngularJS 编码之前您有正确的请求。

图资源管理器网址:https ://graphexplorer2.azurewebsites.net/

希望这可以帮助。

于 2015-12-24T16:22:16.203 回答
0

我所属的 Office 365 统一组:https://graph.microsoft.com/v1.0/me/memberOf/$/microsoft.graph.group?$filter=groupTypes/any(a:a%20eq%20'unified')

于 2015-12-26T02:54:54.037 回答