Can a bot create a new private channel programatically?

Bhaskar Gandavabi 21 Reputation points
2022-04-28T18:38:23.5+00:00

I am trying to create a bot (a Teams app) that can create new private channels as needed. Is that possible? I am able to do this in Slack and was wondering if the same is possible in Microsoft Teams

Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,835 questions
0 comments No comments
{count} votes

Accepted answer
  1. Prasad-MSFT 5,616 Reputation points Microsoft Vendor
    2022-05-05T05:31:08.107+00:00

    Please refer below doc which explains how to create private channel using Graph API
    https://learn.microsoft.com/en-us/graph/api/channel-post?view=graph-rest-1.0&tabs=http#example-2-create-private-channel-on-behalf-of-user

    Thanks,

    Prasad Das


    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Bhaskar Gandavabi 21 Reputation points
    2022-05-09T19:59:12.94+00:00

    I have a followup question. I am trying to write a Teams App that uses an Azure Bot. When I login to Graph Explorer, I am able to run these commands and successfully create a channel. But, when I try to use the Microsoft AppID/Secret combination to obtain an access token outside of Graph Explorer (I am using Postman), I am getting an error that my access token is wrong or I do not have a valid Office 365 subscription. I am trying to develop a Teams App that I can list on Microsoft Teams Appstore. In that case, I want my code to be able to run anyone's Teams installation not just my own.