SOLVED
Home

How to get the list of Microsoft Team

%3CLINGO-SUB%20id%3D%22lingo-sub-131508%22%20slang%3D%22en-US%22%3EHow%20to%20get%20the%20list%20of%20Microsoft%20Team%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-131508%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Guys%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI'm%20writing%20a%20program%20that%20will%20list%20all%20Microsoft%20Teams.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI'm%20using%26nbsp%3B%3CSTRONG%3E%2Fbeta%2Fgroups%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eto%20list%20all%20groups.%20Then%2C%20I%20check%20each%20group%20using%26nbsp%3B%3CSTRONG%3E%2Fbeta%2Fgroups%2F%7Bgroup-id%7D%2Fteam%3C%2FSTRONG%3E%26nbsp%3Bto%20check%20wether%20that%20group%20is%26nbsp%3Ba%20team%20or%20not.%20I%20can%20list%20few%20teams%20but%20most%20of%20it%20I%20can't.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20response%20below%20is%20returned%20to%20the%20team%20that%20I%20cannot%20access.%20Is%20it%20because%20I'm%20not%20a%20member%20of%20the%20group%2C%20that's%20why%20I%20can't%20access%20it%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%7B%0A%20%20%20%20%22error%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22code%22%3A%20%22AccessDenied%22%2C%0A%20%20%20%20%20%20%20%20%22message%22%3A%20%22Failed%20to%20execute%20Skype%20backend%20request%20GetThreadRequest.%20Request%20Url%3A%20https%3A%2F%2Fbn3p-client-dc.msg.skype.com%2Fv1%2Fthreads%2F19%3A03123d1222474b04ac7982a9f1735374%40thread.skype%3Fview%3Dmsnp24Equivalent%2C%20Request%20Method%3A%20GET%2C.%20The%20server%20failed%20to%20respond%20correctly.%20Response%20Code%3A%20Forbidden%2C%20Reason%3A%20Forbidden...%22%2C%0A%20%20%20%20%7D%0A%7D%3C%2FPRE%3E%0A%3CP%3EIs%20there%20any%20other%20way%20I%20can%20check%20if%20a%20group%20is%20a%20team%20or%20not%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20let%20me%20know.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-131508%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-242741%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20the%20list%20of%20Microsoft%20Team%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-242741%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Nino%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWould%20it%20be%20possible%20for%20you%20share%20the%20code%2C%20as%20I%20am%20also%20puzzled%2C%20how%20to%20restructure%20all%20MS%20Teams%20for%20an%20Organization.%20Help%20would%20be%20highly%20Appreciated!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-134657%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20the%20list%20of%20Microsoft%20Team%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-134657%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20reason%20this%20function%20wasn't%20built%3F%20Is%20there%20a%20security%20or%20privacy%20concern%3F%20It%20does%20seem%20like%20a%20basic%20need%20for%20administrators%20to%20help%20curate%20and%20guide%20new%20adopters%20of%20this%20capability.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-131617%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20the%20list%20of%20Microsoft%20Team%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-131617%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20for%20the%20quick%20reply%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20think%20I've%20found%20a%20solution...%20by%26nbsp%3Busing%26nbsp%3B%3CSTRONG%3E%2Fbeta%2Fgroup%2F%7Bgroup-id%7D%2Fteam%26nbsp%3B%3C%2FSTRONG%3Eif%20a%20group%20is%20not%20a%20Team%2C%20I%20found%20that%20the%20response%20code%20is%26nbsp%3B%3CEM%3E404%20Not%20Found%3C%2FEM%3E.%20If%20it's%20a%20Team%2C%20the%20response%20code%20is%20either%20%3CEM%3E200%20OK%3C%2FEM%3E%26nbsp%3Bor%26nbsp%3B%3CEM%3E403%20Forbidden.%3C%2FEM%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-131606%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20the%20list%20of%20Microsoft%20Team%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-131606%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20only%20methods%20that%20we%20currently%20have%20available%20is%20to%20indeed%20query%20the%20Groups%20you%20are%20a%20member%20of.%20And%20yeah%2C%20I%20agree%20it%20sucks.%20Supposedly%20some%20better%20method%20is%20coming%20soon%20via%20the%20API%2C%20although%20I%20wont%20be%20surprised%20if%20it's%20the%20same%20thing...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-131519%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20the%20list%20of%20Microsoft%20Team%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-131519%22%20slang%3D%22en-US%22%3E%3CP%3EI%20found%20that%20I%20cannot%20access%20a%26nbsp%3BTeam%20using%26nbsp%3B%3CSTRONG%3E%2Fbeta%2Fgroups%2F%7Bgroup-id%7D%2Fteam%26nbsp%3B%3C%2FSTRONG%3Eif%20I'm%20not%20a%20member%20or%20owner%20of%20that%20Team.%20That's%20why%20it%20returns%20Forbidden%20403%20response.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%7B%0A%20%20%20%20%22error%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22code%22%3A%20%22AccessDenied%22%2C%0A%20%20%20%20%20%20%20%20...%0A%20%20%20%20%20%7D%0A%20%20%20%20%20...%0A%7D%3C%2FPRE%3E%0A%3CP%3EMy%20question%20is%2C%20is%20there%20any%20other%20way%20to%26nbsp%3Btell%20whether%20that%20certain%20group%20is%20a%20Team%20or%20not%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20help.%20Thank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Nino Paolo
New Contributor

Hi Guys,

 

I'm writing a program that will list all Microsoft Teams.

 

I'm using /beta/groups to list all groups. Then, I check each group using /beta/groups/{group-id}/team to check wether that group is a team or not. I can list few teams but most of it I can't.

 

The response below is returned to the team that I cannot access. Is it because I'm not a member of the group, that's why I can't access it?

 

{
    "error": {
        "code": "AccessDenied",
        "message": "Failed to execute Skype backend request GetThreadRequest. Request Url: https://bn3p-client-dc.msg.skype.com/v1/threads/19:03123d1222474b04ac7982a9f1735374@thread.skype?view=msnp24Equivalent, Request Method: GET,. The server failed to respond correctly. Response Code: Forbidden, Reason: Forbidden...",
    }
}

Is there any other way I can check if a group is a team or not?

 

Please let me know.

 

Thanks.

 

5 Replies

I found that I cannot access a Team using /beta/groups/{group-id}/team if I'm not a member or owner of that Team. That's why it returns Forbidden 403 response.

 

{
    "error": {
        "code": "AccessDenied",
        ...
     }
     ...
}

My question is, is there any other way to tell whether that certain group is a Team or not?

 

Please help. Thank you.

Highlighted

The only methods that we currently have available is to indeed query the Groups you are a member of. And yeah, I agree it sucks. Supposedly some better method is coming soon via the API, although I wont be surprised if it's the same thing...

Solution

Thank you for the quick reply @Vasil Michev

 

I think I've found a solution... by using /beta/group/{group-id}/team if a group is not a Team, I found that the response code is 404 Not Found. If it's a Team, the response code is either 200 OK or 403 Forbidden. 

Is there a reason this function wasn't built? Is there a security or privacy concern? It does seem like a basic need for administrators to help curate and guide new adopters of this capability.

Hi Nino,

 

Would it be possible for you share the code, as I am also puzzled, how to restructure all MS Teams for an Organization. Help would be highly Appreciated!!

Related Conversations
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
Edge insider Dev bypasses IE mode website list
HotCakeX in Enterprise on
4 Replies