I'm basically trying to create a proactive conversation with the Microsoft Bot Framework. I succeeded to do so for Skype for BUsiness with the following code:
string serviceUrl = "https://api.skypeforbusiness.com/platformservice/botframework";
MicrosoftAppCredentials.TrustServiceUrl(serviceUrl);
var connector = new ConnectorClient(new Uri(serviceUrl), "{app-id}", "{app-password}");
var user = new ChannelAccount("[email protected]", "Name of User");
var bot = new ChannelAccount("[email protected]", "Name of bot");
ConversationParameters cpMessage = new ConversationParameters(true, bot, new List<ChannelAccount> { user }, "Topic of the conversation");
ConversationResourceResponse response = await connector.Conversations.CreateConversationAsync(cpMessage);
After initiating the conversation I am able to send messages to the user, works perfectly. But for MS Teams, I have two questions: 1. Which serviceURL is the right one? I found several hints, including urls starting with "https://smba.trafficmanager.net …" but none of them worked, I always get an exception "Bad Request".
The second question: Do I need a Teams-Context (Teams ID) to actually post a message or is it (as in my example with skype) possible to just initiate a chat with a user?
EDIT: I tried to add channelData (teamsChannelId) and used the Service URL "https://smba.trafficmanager.net/emea-client-ss.msg" - then I get the response code "Forbidden". This brings me to the question: Is it actually possible to initiate a conversation into teams WITHOUT any Team-Context (just a chat)?
Thanks in advance, Martin