Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

[Question] How to save custom data in conversion while initiating conversation from bot? #3374

@gomteshhatgine

Description

@gomteshhatgine

System Information

  • SDK Language: .NET

Issue Description

Currently from custom API I successfully initiating conversation using Bot in MS teams channels and sending Hero card into channel but after that I have to set conversation data like SetConversationData So How can I put that some data after sending Hero card

Code Example

       public async Task<HttpResponseMessage> PostCard(ClauseRequest clauseRequest)
          {
            try
            {

                var channelId = "19:" + tempChannelId + "@thread.skype";
                var serviceUrl = ConfigurationManager.AppSettings["ServiceUrl"];
                var connector = new ConnectorClient(new Uri(serviceUrl));
                var channelData = new Dictionary<string, string>();
                channelData["teamsChannelId"] = channelId;
                IMessageActivity newMessage = Activity.CreateMessageActivity();
                newMessage.Type = ActivityTypes.Message;

                var attachment = GetHeroCard(clauseRequest);
                newMessage.Attachments.Add(attachment);

                ConversationParameters conversationParams = new ConversationParameters(
                    isGroup: true,
                    bot: null,
                    members: null,
                    topicName: "Test Conversation",
                    activity: (Activity)newMessage,
                    channelData: channelData);
                MicrosoftAppCredentials.TrustServiceUrl(serviceUrl, DateTime.MaxValue);
                var temp = await connector.Conversations.CreateConversationAsync(conversationParams);

                /**// After this, here I want to save some data into conversation**
              // As this is custom API I dont have Activity object

                var response = Request.CreateResponse(HttpStatusCode.OK);
                return response;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

Expected Behavior

After initiating conversation by Bot I have to save some state data

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions