Rajat Jain
Rajat Jain

Reputation: 482

How to serve a get request in Microsoft Bot Framework?

I am not able to find a way to access/edit user data in response to a request by another server in node.js.

My particular use case involves updating some values for a particular user with the values that the server sends. The server currently has the conversation address stored with it for all users.

Also, I plan to implement serving GET requests to the same server provided I am able to access the data.

Upvotes: 1

Views: 314

Answers (1)

Xeno-D
Xeno-D

Reputation: 2213

To access any conversations BotState you need 2 pieces of information. First you need the channelId, second you need the conversationId.

I don't know where you are performing this logic so I'm going presume this happens in the MessageController and that you have already parsed the 2 id's

var channelId = //Parse channel ID => "Skype", "Slack", ...
var conversationId = //Parse conversationId

var stateClient = activity.GetStateClient(); //activity is of type Activity.
var conversationData = stateClient.BotState.GetConversationData(channelId, conversationId);

//Change data.

Upvotes: 1

Related Questions