1
votes

I'm trying to use Direct Line API of microsoft bot framework,

Following steps are followed.

  1. Got Conversation Id from application(running on node.js)

[conversationId123]

  1. Create Conversation Token from postman https://directline.botframework.com/api/tokens/conversation

[ConversationToken456]

  1. Get Conversation Messages using conversationId123 & Authorization header using ConversationToken456

https://directline.botframework.com/api/conversations/conversationId123/messages

I receive

BadArgument:Security token not valid for this conversation

Did I miss something?

2

2 Answers

0
votes

Hard to know what's going wrong without seeing the whole flow; though the error indicates that the token is invalid.

Here is a DirectLine sample using Node.js. You might want to use it as the baseline for your sample and I'm pretty sure you will find out the error.

0
votes

I think before sending a message to the BOT you should call the URL stream that returns from the initial "Start conversation" POST request. At least that appears at the documentation In my case, using C# I'm able to retrieve a token, then message ID and even request the bot to send me a list of activities, but I'm unable to send a message (the POST request never comes back with an answer)