Bot ClientConnector CreateDirectConversationAsync return MethodNotAllowed

34 views Asked by At
var connector = new ConnectorClient(new Uri(serviceUrl), new MicrosoftAppCredentials(microsoftAppId, microsoftAppPassword));

await connector.Conversations.CreateDirectConversationAsync(activity.From, activity.Recipient, activity);

ex

Im trying to create a new Directline Conversation using ClientConnecton, but every time CreateDirectConversationAsync() throw exception MethodNotAllowed

1

There are 1 answers

0
AP01 On

If you're trying to communicate with a bot over Direct Line, the preferred way would be to communicate with the bot using the Direct Line API. It is designed to allow communication with the bot over simple REST calls.

To use it, you will need an Azure Bot resource deployed to Azure with its messaging endpoint set to the endpoint where the bot itself is running, and the Direct Line channel enabled. The docs explain how to configure it. Once it is set up, you can use any library you wish to connect with the bot.