I'm implementing a new channel for my bot's front end using the botframework-directlinejs NodeJS SDK. This channel will provide some custom back-channel functionality; however, my bot needs to know that the conversation it is communicating with is via this channel before it can construct an activity to use it.
From what I can gather from the 'Activity' object in the API, the channelId field should be set by the channel.
However,
myChannel.postActivity({
type: 'message',
text: 'hi',
from: {
id: "Node test user",
},
channelId: 'myChannel'
}).subscribe(
id => console.log("Posted activity, assigned ID ", id),
error => console.log("Error posting activity", error)
);
indeed sends the message 'hi' to my bot, but the channelId comes out as 'directline'.
Performing this same operation in Fiddler as a post to https://directline.botframework.com/v3/directline/conversations/<conversationID>/activities has the same response.
My suspicion is that the 'channelId' property of the Activity object is read-only, and that the API adds this value.
Is it possible to set a custom id of the channel?