Will Conversation id in bot message change?

Teams TA 161 Reputation points

I want to send something to a Teams chat by bot when my service receive message.
As we know, when user send @Bot in a one-to-one chat, we will receive an composeExtension message, we can get the conversation id in the message and response the event by conversation id.

But without any request, what should i do? I know that I can create a conversation in channel by channel id or create a conversation in user bot chat. But if i want to send proactive message to a chat or group chat, what should i do?

I found that the conversation id is same as groupChat id (id from graph api response), what's more, it also is same as channelData.setting.selectedChannel.id in installationUpdate message.
I wonder if they are related or same, and will the conversation id change in the future. If it doesn't change, can I store it to my database and use it to send proactive messages.

Please help

Azure Bot Service
Azure Bot Service
An Azure service that provides an integrated environment for bot development.
544 questions
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.
1,708 questions
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
5,371 questions
{count} votes

Accepted answer
  1. Sayali-MSFT 1,416 Reputation points Microsoft Employee

    Use either the conversationReference object or conversationId and tenantId to send the message. You can get this ID by either creating the conversation or storing it from any activity sent to you from that context.

    You must only create the conversation once and store the conversationId value or conversationReference object", so we have to store the conversation id if we want to use it

    Ref: Send proactive messages - Teams | Microsoft Learn



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

0 additional answers

Sort by: Most helpful