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!
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
Proud to be a Flownaut!
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.
@VictorIvanidze this is the whole flow. I also add an image of the error step and message.
Flow_details
Flow results
Have a look at this:
https://myteamsday.com/2020/01/03/create-private-channel-graph-api/
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?
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Read the latest about new experiences and capabilities in the Power Automate product blog.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
26 | |
25 | |
22 | |
21 | |
17 |
User | Count |
---|---|
58 | |
42 | |
36 | |
30 | |
30 |