I am trying to use the Microsoft Bot Framework DirectLine API to read and add messages to existing conversations between other users and my bot. From what I read, I believe that this should be possible using the master secret, but it just doesn’t work for me. I use WebAPI to try to access two of my existing conversations (on Facebook and Skype) as follows:
[HttpPost]
[Route("remind")]
public string Remind()
{
var secret = System.Configuration.ConfigurationManager.AppSettings["secret"];
var uri = new Uri("https://directline.botframework.com/");
var creds = new DirectLineClientCredentials(secret);
DirectLineClient client = new DirectLineClient(uri, creds);
Conversations convs = new Conversations(client);
var conversationIDs = new string[] { "0000000000000000-0000000000000000", "00:0123456789abcdefghijklmnopqrstuvwxyz0123456789-A-_0123456798ABCDEF" };
foreach (var conversationID in conversationIDs)
{
Message message = new Message(conversationId: conversationID, fromProperty: "My Bot", text: "Hey dude, remember that thing!");
Console.WriteLine(message.Text);
convs.PostMessage(conversationID, message);
}
string waterMark = null;
var set = convs.GetMessages(conversationIDs[0], waterMark);
waterMark = set.Watermark;
return "Done :-)";
}
PostMessage() 404 GetMessages(). , , .., Facebook Skype DirectLine API. , DirectLine API, .
, , , :
Microsoft Bot Framework
.