Forum Discussion
jasonburek
Apr 10, 2023Copper Contributor
Channel context from command box
I've been exploring using the command box as an entry point to my application. After the user is done, I'd like to post a card to a channel. The problem I'm running into is that I can't figure out ho...
jasonburek
Apr 10, 2023Copper Contributor
I think I at least partially figured this out. I haven't figured out how to get the channel context from within the messaging extension itself but it looks like the javascript context does contain that information so I can use it from there.
- Prasad_Das-MSFTApr 11, 2023
Microsoft
jasonburek - When we tried to invoke messaging extension from command box in channel scope,
we are getting context as below:{ "name": "composeExtension/query", "type": "invoke", "timestamp": "2023-04-11T06:37:01.408Z", "localTimestamp": "2023-04-11T12:07:01.408+05:30", "id": "f:66e020e0-e1a2-ef8e-41fe-e53714d96ce8", "channelId": "msteams", "serviceUrl": "https://smba.trafficmanager.net/amer/", "from": { "id": "29:1GdHzmtVE_hN2wPrVQSb0fdMuI-HG8_kDOUXSNcf1pCKVfQQNnDqsRBZ6kGaAVUlNYy7BzXbQc1dg38oMTNnKOg", "name": "MOD Administrator", "aadObjectId": "4ebcc4d0-291b-4154-a85f-a89cd77aefa8" }, "conversation": { "tenantId": "36a708ef-700d-4d60-9de0-0a5f7b7693df", "id": "29:1GdHzmtVE_hN2wPrVQSb0fdMuI-HG8_kDOUXSNcf1pCKVfQQNnDqsRBZ6kGaAVUlNYy7BzXbQc1dg38oMTNnKOg" }, "recipient": { "id": "28:448ec85c-4395-4f80-b5a1-cd3bdefd1f5b", "name": "AzBotPSD" }, "entities": [ { "locale": "en-US", "country": "US", "platform": "Web", "timezone": "Asia/Calcutta", "type": "clientInfo" } ], "channelData": { "tenant": { "id": "36a708ef-700d-4d60-9de0-0a5f7b7693df" }, "source": { "name": "powerbar" } }, "value": { "commandId": "searchQuery", "parameters": [ { "name": "initialRun", "value": "true" } ], "queryOptions": { "skip": 0, "count": 25 } }, "locale": "en-US", "localTimezone": "Asia/Calcutta" }
- jasonburekApr 11, 2023Copper ContributorThat looks similar to what I'm seeing. There is a section for "conversation" but that ID matches the From ID so it appears to be a reference to the 1:1 conversation with the user. I'm not seeing anything in there that would lead me back to the Team/Channel that's currently open.
- Prasad_Das-MSFTApr 13, 2023
Microsoft
jasonburek - Yes , any channel related context is not available there.