cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sngbcn
Frequent Visitor

Issue with Create Private Channel via Power Automate?

I'm creating a flow to provision Teams with a certain structure, a template, but when I get to the point of creating the private channel there is no way to get it right. I'm always trying to do the same using the graph explorer but when I paste the json body in power automate there's an error message.

 

This is the code that works in the Graph Explorer:

POST https://graph.microsoft.com/beta/teams/{group_id}/channels
Content-type: application/json

{ "membershipType": "Private",
  "displayName": "Confidential info",
  "members":[{    
           "@odata.type":"#microsoft.graph.aadUserConversationMember",
           "user@odata.bind":"https://graph.microsoft.com/beta/users('<userID>')",
           "roles":["owner"]
            }]
}

and this is the request body according to the documentation:

POST https://graph.microsoft.com/beta/teams/{group_id}/channels
Content-type: application/json

{
  "@odata.type": "#Microsoft.Teams.Core.channel",
  "membershipType": "private",
  "displayName": "My First Private Channel",
  "description": "This is my first private channels",
  "members":
     [
        {
           "@odata.type":"#microsoft.graph.aadUserConversationMember",
           "user@odata.bind":"https://graph.microsoft.com/beta/users('{user_id}')",
           "roles":["owner"]
        }
     ]
}

I added the code from graph explorer directly to a flow but when I run it the following error message appears:

{
  "error": {
    "code": "BadRequest",
    "message": "channel cannot be null.\r\nParameter name: channel",
    "innerError": {
      "request-id": "<id>",
      "date": "<date>"
    }
  }
}

Any ideas?

Thanks!

6 REPLIES 6
efialttes
Super User
Super User

Hi!

Haven't tried myself but this article describes a similar successful scenario

https://myteamsday.com/2020/01/03/create-private-channel-graph-api/

Now, in the article's comments thread a similar issue is described

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



sngbcn
Frequent Visitor

In fact I've tried a few approachs:

 

- @odata.bind as a string inside a variable

- the whole json inside a variable 

- the double @ sign in front if odata.bind

 

all of them with no positive results 

 

Hi @sngbcn, please show your flow. 

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

@VictorIvanidze this is the whole flow. I also add an image of the error step and message.

Flow_detailsFlow_details

 

 

Flow resultsFlow results

 

Have a look at this:

https://myteamsday.com/2020/01/03/create-private-channel-graph-api/

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

hi @VictorIvanidze @efialttes I have already followed the advice in that website without any luck. As I commented I have accomplished creating a new channel through Graph Explorer but the same code fails when running a flow...

 

Have you tried it even with a basic flow? Do you see anything missing in the http request?

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,749)