I've set up a simple bot - registered with Bot Connector - and I'm just trying to get the basic Direct Line API connection set up. In my separate application (C#), I've succeeded at initiating a conversation by using an HttpClient and retrieving the conversationId (by deserializing the response).
However, I then attempt to post a message to the thread, and I'm getting a "Internal Server Error", error code 500. The only message attached is "An error has occurred.".
using(var client = new HttpClient())
{
client.BaseAddress = new Uri("https://directline.botframework.com/");
client.DefaultRequestHeaders.Clear();
client.DefaultRequestHeaders.Add("Authorization", $"BotConnector {token}");
client.DefaultRequestheaders.Add("Type", "Message");
var post_content = new StringContent("Adding to the convo", Encoding.UTF8, "application/json");
HttpResponseMessage response = new client.PostAsync($"api/conversations/{convo_id}/messages", post_content).Result;
log(response.ReadAsStringAsync().Result);
}
log is a simple method to output to the console, while convo_id is the conversationId taken from the initial call to the site.