botframework-sdk
botframework-sdk copied to clipboard
Entering an existing conversation from DirectLine - FORBIDDEN RESPONSE
The C# code below errors with a forbidden response even though I'm using a valid Secret for my client. I'm doing this from the debug client as opposed to the live client, is this supported? Anything jump out at anybody? TIA
//using a valid secret
var creds = new DirectLineClientCredentials(Constants.Constants.DirectLineSecret);
var uri = new Uri("https://directline.botframework.com");
var client = new DirectLineClient(uri, creds);
var conversations = new Conversations(client);
var token = new Tokens(client);
//this is an existing valid conversation id
token.RenewToken(conversationId);
var message = new Message(conversationId: conversationId, text: "fawesome");
conversations.PostMessage(conversationId, message);
`
I think you're overdoing it. :)
If you want to restart an existing conversation:
var client = new DirectLineClient(secret); var message = ... client.Conversations.PostMessage(conversationId, message);