I'm having an Adaptive card with a share button, on click of that button I have shared that card to other Teams channel, as of now I'm able to send the message to the same Teams channel, but while sending to other teams channel it giving me Error. Below is the code i'm using:
var tenantID = activity.GetTenantId();
var message = Activity.CreateMessageActivity();
message.Text = "Hello World";
var conversationParameters = new ConversationParameters
{
IsGroup = true,
ChannelData = new TeamsChannelData
{
Channel = new ChannelInfo("ID of Channel to which message is to be sent"),
Team = new TeamInfo("ID of team to which message to be sent", "Name of team");
Tenant = new TenantInfo(tenantID),
Notification = new NotificationInfo(true)
},
Activity = (Activity)message
};
MicrosoftAppCredentials.TrustServiceUrl(activity.ServiceUrl, DateTime.MaxValue);
var connectorClient = new ConnectorClient(new Uri(activity.ServiceUrl));
await connectorClient.Conversations.CreateConversationAsync(conversationParameters);