I'm sending data from the web chat client, to the Bot via channel data, the following way:
const store = window.WebChat.createStore({}, ({ dispatch }) => next => action => {
if (action.type === 'DIRECT_LINE/POST_ACTIVITY') {
// The channelData submitted here is very similar to HTTP cookies and vulnerable to forgery attack.
// Make sure you use signature to protect it and verify the signature on the bot side.
// To minimize unexpected behaviors, we recommend to treat the "action" object as if it is immutable.
// We use simple-update-in package to update "action" with partial deep cloning.
action = window.simpleUpdateIn(
action,
['payload', 'activity', 'channelData', 'myCustomProperty'],
() => 'Custom value'
);
}
return next(action);
});
How do I access this data on the server side using C#?
You can access it under channelData which is present under context object,full path below
dialogContext.Context.Activity.ChannelData