botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Conversations.SendToConversation gives "Gateway Timeout" for ms teams

Open celloudiallo opened this issue 9 years ago • 2 comments

starting a direct conversation with ms teams gives a timeout.

Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'GatewayTimeout' at Microsoft.Bot.Connector.Conversations.<SendToConversationWithHttpMessagesAsync>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Bot.Connector.ConversationsExtensions.<SendToConversationAsync>d__15.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

Here is my code and it works fine with Skype.

`var userAccount = new ChannelAccount(name: account.Name, id: account.Id); var botAccount = new ChannelAccount(name: account.BotName, id: account.BotID);

            MicrosoftAppCredentials.TrustServiceUrl(account.ServiceUrl);

            var connector = new ConnectorClient(new Uri(account.ServiceUrl));
            var conversationId = connector.Conversations.CreateDirectConversation(botAccount, userAccount);

            IMessageActivity activity = Activity.CreateMessageActivity();
            activity.From = botAccount;
            activity.Recipient = userAccount;
            activity.ChannelId = account.ChannelId;
            activity.ServiceUrl = account.ServiceUrl;
            activity.Conversation = new ConversationAccount(id: conversationId.Id, isGroup: false);
            activity.Text = "Hello";
            activity.Locale = "en-Us";

            connector.Conversations.SendToConversation((Activity)activity, conversationId.Id);`

celloudiallo avatar Dec 12 '16 19:12 celloudiallo

Apologies for the slow response.

Currently neither CreateDirectConversation nor CreateConversation is supported in the current implementation of Bots in Teams. We should have updates on our Bots support in the next month or so, so stay tuned for more functionality and updated documentation.

RichMoeMSFT avatar Dec 21 '16 18:12 RichMoeMSFT

Closing as this is not currently supported. Please feel free to at-mention or open a new issue if you'd like to discuss further.

dandriscoll avatar Dec 21 '16 23:12 dandriscoll