MS Graph Explorer - 列出加入的团队 - 错误 404 [英] MS Graph Explorer - List joined teams - error 404

查看:23
本文介绍了MS Graph Explorer - 列出加入的团队 - 错误 404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了数百篇与几个 MS 图形浏览器 API 问题相关的帖子,但我自己却无法解决;我希望我不会与另一篇文章重叠,并且您会友善:) !!

我正在尝试在我的 typescript (angular-cli) 应用程序中执行以下请求:

https://graph.microsoft.com/beta/me/joinedTeams

使用此代码:

私人 findMyTeams() {常量 = 这个;this.listMyTeams().subscribe(items => {that.joinedTeams = items.value;//在 html 中使用 *ngFor});}listMyTeams() {var client = this.getClient();从(客户)返回.api('我/加入的团队').version("测试版").得到());}

仅供参考:

  • 令牌很好(我设法在同一个应用程序中计算其他查询以用于其他目的,例如一个驱动器......)
  • 身份验证过程进展顺利
  • 代码没有错误(我希望)来自 MS 官方示例,稍作调整,但核心开发人员不是我的 =>

    <块引用>

    VM3361 polyfills.js:3372 GET

    我还直接在 MS Graph 资源管理器工具中运行了查询,结果不幸与您在下面看到的相同:

    请注意,我已经加入了团队,如下所示

    而且我在 Azure AD 上有一个会员帐户,如下面的屏幕所示:

    解决方案

    根据你的描述,我假设你想列出加入的团队,但得到 404 错误代码.

    根据我的测试,出现这个问题的原因有两个.

    #1,当我们使用以下 API 时,我们应该先登录我们的团队.p>

    GET/beta/me/joinedTeams

    #2,我们应该使用有效的 Azure AD 帐户来访问 API.Azure AD 帐户中的来宾帐户可能无法访问团队资源.

    I've been reading hundreds and hundreds of posts related to several MS graph explorer API issues without being able to solve mine by myself; I hope I don't overlap with another post and that you'll be kind :) !!

    I'm trying to perform the following request in my typescript (angular-cli) app :

    https://graph.microsoft.com/beta/me/joinedTeams
    

    with this code :

    private findMyTeams() {
      const that = this;
      this.listMyTeams().subscribe(items => {
        that.joinedTeams = items.value; // used in html *ngFor
      });
    }
    
    listMyTeams() {
      var client = this.getClient();
      return from(client
        .api('me/joinedTeams')
        .version("beta")
        .get()
      );
    }
    

    FYI :

    • token is good (I managed to compute other queries in the same app for other purposes e.g One drive ...)
    • the Auth process went well
    • the code is bugfree (I hope) coming from MS official sample with a bit tweaks but the core dev is not mine => https://github.com/microsoftgraph/angular4-connect-sample
    • I'm using the following rights :

      scope: 'User.Read, User.Read.All, User.ReadWrite.All, Files.Read.All, Files.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All, Group.Read.All, Group.ReadWrite.All'

    and this is what I always get as my http response from Graph API :

    VM3361 polyfills.js:3372 GET https://graph.microsoft.com/beta/me/joinedTeams 404 (Not Found)

    I've also run the query in MS Graph explorer tool directly and got the unfortunate same result as you can see here below :

    Please note that I have already joined teams as you can see hereafter

    And also that I have a member account on Azure AD as the screen below says so :

    解决方案

    According to your description, I assume you want to list the joined teams but get the 404 Error Code.

    Based on my test, There are two reasons why this problem may occur.

    #1, when we use the following API, we should login in our teams first.

    GET /beta/me/joinedTeams

    #2, we should use a valid Azure AD account to access the API. The guest account in the Azure AD Account may couldn’t access the teams resources.

    这篇关于MS Graph Explorer - 列出加入的团队 - 错误 404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆