Skip to main content

Notifications

Power Platform Community / Forums / Building Flows / Create a Team with Graph
Building Flows
Suggested answer

Create a Team with Graph

Posted on by 6
Hi
 
I'm trying to create a Team using the Graph API, but it fails.
 
I have an application in Entra with these permissions:
Directory.ReadWrite.All
Group.Create
Group.ReadWrite.All
Team.Create
TeamMember.ReadWrite.All
TeamSettings.ReadWrite.All
User.Read
User.Read.All
 
In Power Automate, I have added an HTTP-action, configured like this:
 
According to https://learn.microsoft.com/en-us/graph/api/team-post?view=graph-rest-1.0&tabs=http#example-2-application-permissions this is the correct way to call the API for creating a Team. However it fails miserably like this:
 
 
 
I have no idea why it's giving me a HTTP 400 invalid request URL? That's https://graph.microsoft.com/v1.0/teams, right?
 
Has anyone successfully created a team with Graph in Power Automate? (I'm creating teams just fine using the API in my own code, using the same Entra app, it just doesn't work in Power Automate)
  • VJ-16091057-0 Profile Picture
    VJ-16091057-0 2 on at
    Create a Team with Graph
    Thanks for your answer, FLMike.
     
    As stated, I can create a team via the API (for example using Graph Explorer), but it fails in Power Automate.
    When creating with app permissions, you must provide a user to be owner, as it doesn't run in a user-context. The double @'s is because Power Automate uses Workflow Definition Language, and they must be escaped, or you will get this: 
    "The input parameter(s) of operation 'HTTP' contains invalid expression(s). Fix invalid expression(s) for the input parameter(s) of operation 'HTTP'."
    (Reference: https://community.powerplatform.com/forums/thread/details/?threadid=a6d931d7-81e8-4c91-8016-8826cc227cc3)
     
    If anyone has successfully created a Team in Power Automate using application permissions, I'm eager to learn, because following the documentation does *not* do the trick :)
  • CU13091257-0 Profile Picture
    CU13091257-0 6 on at
    Create a Team with Graph
    Thanks for your answer, FLMike. As stated, I can create a team via the API (for example using Graph Explorer), but it fails in Power Automate.
    When creating with app permissions, you must provide a user to be owner, as it doesn't run in a user-context. The double @'s is because Power Automate uses Workflow Definition Language, and they must be escaped, or you will get this: 
    "The input parameter(s) of operation 'HTTP' contains invalid expression(s). Fix invalid expression(s) for the input parameter(s) of operation 'HTTP'."
    (Reference: https://community.powerplatform.com/forums/thread/details/?threadid=a6d931d7-81e8-4c91-8016-8826cc227cc3)
    If anyone has successfully created a Team in Power Automate using application permissions, I'm eager to learn, because following the documentation does *not* do the trick :)
  • Suggested answer
    FLMike Profile Picture
    FLMike 23,258 on at
    Create a Team with Graph
    Hi,
     
    I will provide you with how to resolve it, so as to better help than just saying.
     
    Use this.
     
     
    There you will see the following, which you need to fill in to make it work. Test it out there first, then you will easily be able to create it in PA.
    that being said the issue is specifically getting the oAuth Token, also why are you using double @@??

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,719

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard

Featured topics