SOLVED

Auto approve a join request

Copper Contributor

Hi everyone,

 

we´re currently trying to auto approve join requests for Microsoft Teams.

I just checked the whole process and found out that through this link you can send a POST approval which is accepting the invite.

 

https://teams.microsoft.com/api/mt/emea/beta/teams/joinRequestAdminAction?silentAction=false

 

The Body included in this POST:

 

{"GroupId":"123","UserMri":"1:orgid:123","ActionType":"Accept"}

 

 However when I´m trying to do this on my own with an "authorized user" I´m getting the error message "Unauthorized".

 

Anybody a idea?

 

BR

6 Replies
Any ideas anyone?
best response confirmed by ThereseSolimeno (Microsoft)
Solution

Hi @belasor ,

 

That's an internal API used by the Teams UI, it's not documented and realistically you'll struggle to achieve authentication for any other process to call it. There is an unofficial powershell that tries, but it's majorly unsupported.

 

The official supported apis for Teams are at graph.microsoft.com. There isn't an api to specifically approve a request, but you can just add a member, this would clear the pending request anyway. See Add member to team - Microsoft Graph beta | Microsoft Docs.

 

I'm not sure I really see what you are trying to achieve, why not make the group Public then there simply isn't a need for a user to be approved or added, they just join immediately.

Yeah the approach seems a bit off here. What is the goal of auto approving vs just making it public?

Another approach could be to utilize join codes. I'm pretty sure you could find a way to run whatever POST happens when someone enter's these codes into the join screen and replicate that into some automation.

https://support.microsoft.com/en-us/office/create-a-link-or-a-code-for-joining-a-team-11b0de3b-9288-...

Hi @Steven Collier and @Chris Webb,

 

thank you both for the reply.

 

So the problem we have is a little bit complicated. We have a few users within the company which we want to exclude from all public Teams. Unfortunately we couldn´t find anything to resolve that problem.

 

An idea was to auto approve all join requests for teams and just reject all requests from people which are part of group "forbidden".

 

We´ve tried a lot, sensitive labels for groups, Graph API and looking through azure but we couldn´t find anything.

 

 

@belasor I appreciate it's a complex solution that needs E5, but Information Barriers can do exactly this.

@Steven Collier thank you very much for the help.

 

We now bought some licenses for test purposes and I´m setting up the prerequisite.

Unfortunately I can´t see a way to exclude User from a Teams, when the prefix is "ABC" as a example. 

Did I miss something in all the tutorials?

 

Best regards

1 best response

Accepted Solutions
best response confirmed by ThereseSolimeno (Microsoft)
Solution

Hi @belasor ,

 

That's an internal API used by the Teams UI, it's not documented and realistically you'll struggle to achieve authentication for any other process to call it. There is an unofficial powershell that tries, but it's majorly unsupported.

 

The official supported apis for Teams are at graph.microsoft.com. There isn't an api to specifically approve a request, but you can just add a member, this would clear the pending request anyway. See Add member to team - Microsoft Graph beta | Microsoft Docs.

 

I'm not sure I really see what you are trying to achieve, why not make the group Public then there simply isn't a need for a user to be approved or added, they just join immediately.

View solution in original post