MS Graph Explorer - List joined teams - error 404

2020-06-06 02:35发布

问题:

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 :

回答1:

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.