Reputation: 4215
Any attempt to call the methods
Task<ConversationResourceResponse> ConnectorClient.Conversations.CreateConversationAsync(ConversationParameters)
Task<ConversationResourceResponse> ConnectorClient.Conversations.CreateDirectConversationAsync(ChannelAccount, ChannelAccount)
Against endpoint: http://email.botframework.com/
fails with HTTP failure 405 method not allowed.
Code snippet
const string emailServiceUrl = "http://email.botframework.com/";
ConnectorClient connector = new ConnectorClient(new Uri(emailServiceUrl));
ChannelAccount botAccount = new ChannelAccount("bot@mail", null);
ChannelAccount userAccount = new ChannelAccount("user@mail", null);
var conversationId = await connector.Conversations.CreateDirectConversationAsync(botAccount, userAccount);
I could not find any documentation that indicated the exact email channel endpoint, so I used the endpoint here, that looked like it was for skype, and replaced skype
with email
. I noticed the caveat about not relying on the serviceUrl being stable, but I'm not sure what to pick if I'm trying to start a new conversation without any incoming message. If that is the problem.
Upvotes: 0
Views: 546
Reputation: 892
You must add trusted service url :
MicrosoftAppCredentials.TrustServiceUrl(serviceUrl);
After that, your constructor should be :
var connector = new ConnectorClient(new Uri(serviceUrl), microsoftAppId: appdId, microsoftAppPassword: appPassword);
Upvotes: 1