Start conversation in a teams tab using Graph API

Clark Kent 1 Reputation point
2022-01-16T09:29:58.247+00:00

Hello

Is there a way to start the conversation in a Teams tab using graph API? Basically, if we click on the 'Start conversation' button it will create conversation, but I want to do it programmatically.
Also, can we change the size of the chat section in a tab? (The horizontal width specifically)

I would need an API for starting the conversation inside the team's tab. Not to post a message in the team's channel.
Once I start a conversation in the tab programmatically, the message will automatically come into the channel as well.

Please check this link.
https://support.microsoft.com/en-us/office/start-a-conversation-about-a-tab-in-teams-949a39e6-bde5-47f5-8e25-398a2ce009f9

I want to do the above action via some API call.

Thanks
CK

Microsoft Security Microsoft Graph
Microsoft Teams Microsoft Teams for business Other
{count} votes

2 answers

Sort by: Most helpful
  1. Manu Philip 20,206 Reputation points MVP Volunteer Moderator
    2022-01-16T19:12:44.917+00:00

    There is a direct way to send Teams message through Graph API.
    Login, Graph API graph-explorer with your login and select the Team's action needed as below:
    165290-image.png

    Query used is something as below:

    https://graph.microsoft.com/v1.0/teams/your-teams-id/channels/your-channel-id/messages  
    

    Request Body used is as below: You may use a custom message

    {  
        "body": {  
            "content": "Hello world"  
        }  
    }  
    

    The final window looks like below:

    165491-image.png

    After running the query, you will see the success message as well as a message in teams

    I have no idea on changing the size of message window. However, hope the above Graph API method helps

    ----------

    If the Answer is helpful, please click "Accept Answer" and upvote it

    0 comments No comments

  2. Clark Kent 1 Reputation point
    2022-01-19T06:31:47.47+00:00

    @Manu Philip

    Basically, I would need an API for starting the conversation inside the team's tab. Not to post a message in the team's channel.
    Once I start a conversation in the tab programmatically, the message will automatically come into the channel as well.

    Please check this link.
    https://support.microsoft.com/en-us/office/start-a-conversation-about-a-tab-in-teams-949a39e6-bde5-47f5-8e25-398a2ce009f9

    I want to do the above action via some API call. Any luck?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.