Open bandtank opened 1 year ago
Hi bandtank! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.
Best regards, Teams Platform
@bandtank - Could you please let us know which content you want us to update in this doc? Also please refer this and check if it helps: https://learn.microsoft.com/en-us/microsoftteams/platform/messaging-extensions/how-to/search-commands/respond-to-search?tabs=dotnet
Ideally, I think the endpoints should be added to at least the following places:
An example of what would be helpful to see in the first two bullet points is shown here.
As an update, I have learned a few things that are not explained anywhere in the documentation. The message is sent as type invoke
, but responding with a type invoke
does not work, at least not to the endpoint I'm using. The JSON structure shown in the documentation starts with this:
{
"composeExtension":{
"type":"result",
"attachmentLayout":"list",
"attachments":[
...
]
}
}
which seems to be wrong. It might need to look like this:
{
"type":"result",
"attachmentLayout":"list",
"attachments":[
...
]
}
Type result
does not appear to work. An error was returned saying Unknown activity type
. If I send a response with type message
, the results go in the personal chat (if the context is a personal chat), group chat, and so on. Getting the results to appear as list items in the message extension result area is not yet working. That's what I need documentation to achieve:
I checked the browser debug console to see what is being sent. Here is an example:
{
"name": "composeExtension/query",
"value": {
"commandId": "info",
"parameters": [
{
"name": "term",
"value": "sadfasdf"
}
],
"queryOptions": {
"count": 25,
"skip": 0
}
},
"imdisplayname": redacted,
"conversation": {
"id": "19:2402b3bf-99b7-4979-9970-6ad9528a3ba7_2cf61cbd-a711-4f9f-95b4-92a7b20cb017@unq.gbl.spaces"
}
}
This is what my bot received:
{
"name": "composeExtension/query",
"type": "invoke",
"timestamp": "2023-03-31T03:49:00.907Z",
"localTimestamp": "2023-03-30T21:49:00.907-06:00",
"id": "f:1a1a8681-8e28-32df-3441-88a71477e5c1",
"channelId": "msteams",
"serviceUrl": "https://smba.trafficmanager.net/amer/",
"from": {
"id": "29:1kCq75A-g8wVc36XZqhI504r073ByA0Uk0KMcIAIWMvrm_2iivPfbNZ5mDObiz_gFfmkcf2hioAZO5NfG_mfiRw",
"name": redacted,
"aadObjectId": "2402b3bf-99b7-4979-9970-6ad9528a3ba7"
},
"conversation": {
"conversationType": "personal",
"tenantId": redacted,
"id": "a:1HlPo9qAhR5bbfnkumzXUvpkO2yQ4z1lt89QIby3dqHrGLvfRHwnkoPmTOGjNqSGYTDzySM9jJbil18BJ7TOh27eedpe7_rpaHjjKBi62f3v4KaXZShqFtUetdPz2TZ7w"
},
"recipient": {
"id": "28:2cf61cbd-a711-4f9f-95b4-92a7b20cb017",
"name": "CometDev"
},
"entities": [
{
"locale": "en-US",
"country": "US",
"platform": "Web",
"timezone": "America/Denver",
"type": "clientInfo"
}
],
"channelData": {
"tenant": {
"id": redacted
},
"source": {
"name": "compose"
}
},
"value": {
"commandId": "info",
"parameters": [
{
"name": "term",
"value": "sadfasdf"
}
],
"queryOptions": {
"count": 25,
"skip": 0
}
},
"locale": "en-US",
"localTimezone": "America/Denver"
}
Notice the conversation IDs are very different. Why is the bot receiving a different (probably wrong) conversation ID?
I checked the browser debug console to see what is being sent. Here is an example:
{ "name": "composeExtension/query", "value": { "commandId": "info", "parameters": [ { "name": "term", "value": "sadfasdf" } ], "queryOptions": { "count": 25, "skip": 0 } }, "imdisplayname": redacted, "conversation": { "id": "19:2402b3bf-99b7-4979-9970-6ad9528a3ba7_2cf61cbd-a711-4f9f-95b4-92a7b20cb017@unq.gbl.spaces" } }
This is what my bot received:
{ "name": "composeExtension/query", "type": "invoke", "timestamp": "2023-03-31T03:49:00.907Z", "localTimestamp": "2023-03-30T21:49:00.907-06:00", "id": "f:1a1a8681-8e28-32df-3441-88a71477e5c1", "channelId": "msteams", "serviceUrl": "https://smba.trafficmanager.net/amer/", "from": { "id": "29:1kCq75A-g8wVc36XZqhI504r073ByA0Uk0KMcIAIWMvrm_2iivPfbNZ5mDObiz_gFfmkcf2hioAZO5NfG_mfiRw", "name": redacted, "aadObjectId": "2402b3bf-99b7-4979-9970-6ad9528a3ba7" }, "conversation": { "conversationType": "personal", "tenantId": redacted, "id": "a:1HlPo9qAhR5bbfnkumzXUvpkO2yQ4z1lt89QIby3dqHrGLvfRHwnkoPmTOGjNqSGYTDzySM9jJbil18BJ7TOh27eedpe7_rpaHjjKBi62f3v4KaXZShqFtUetdPz2TZ7w" }, "recipient": { "id": "28:2cf61cbd-a711-4f9f-95b4-92a7b20cb017", "name": "CometDev" }, "entities": [ { "locale": "en-US", "country": "US", "platform": "Web", "timezone": "America/Denver", "type": "clientInfo" } ], "channelData": { "tenant": { "id": redacted }, "source": { "name": "compose" } }, "value": { "commandId": "info", "parameters": [ { "name": "term", "value": "sadfasdf" } ], "queryOptions": { "count": 25, "skip": 0 } }, "locale": "en-US", "localTimezone": "America/Denver" }
Notice the conversation IDs are very different. Why is the bot receiving a different (probably wrong) conversation ID?
We checked at our end, and we are getting below response which bot receives and compared that this is the correct conversation id
{
"name": "composeExtension/query",
"type": "invoke",
"timestamp": "2023-04-03T09:27:26.543Z",
"localTimestamp": "2023-04-03T14:57:26.543+05:30",
"id": "f:c38f0ca0-6dfa-f625-40fe-9140a9cd780e",
"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": {
"isGroup": true,
"conversationType": "groupChat",
"tenantId": "36a708ef-700d-4d60-9de0-0a5f7b7693df",
"id": "19:ed13a8deaace437c814032df49c8be90@thread.v2"
},
"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": "compose"
}
},
"value": {
"commandId": "searchQuery",
"parameters": [
{
"name": "initialRun",
"value": "true"
}
],
"queryOptions": {
"count": 25,
"skip": 0
}
},
"locale": "en-US",
"localTimezone": "Asia/Calcutta"
}
Could you please let us know how you are getting the response in console with incorrect conversation id?
I don't know if the conversation ID is a problem yet because I can't get the endpoint to respond in the proper way. The first thing I need to know is:
@bandtank - Please check if you are looking for endpoint as mentioned below: https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-send-and-receive-messages?view=azure-bot-service-4.0#send-the-reply
@Prasad-MSFT I wrote that documentation in a github issue, which was later added to the linked page. It does not apply to this situation. If the endpoint is the same, the instructions for a messaging extension are not explained because there is no activity ID in several contexts when a composeExtension query is sent. The response structure is also not what is shown at that link. The type is wrong, parameters are missing, etc.
Okay, we will check this with engineering team and will update accordingly. Thanks!
Has there been an update?
Apologies. Currently there is no update from engineering team. We are following up with them. We will inform you once we get any update. Thanks!
Any updates? I have the extension in Teams and it has the desired tabs:
Nothing I send in response to this message works:
[
{
"name": "composeExtension/query",
"type": "invoke",
"timestamp": "2023-05-12T20:44:55.541Z",
"localTimestamp": "2023-05-12T14:44:55.541-06:00",
"id": "f:746cc5ab-959c-b7c6-2504-00c76cd83307",
"channelId": "msteams",
"serviceUrl": "https://smba.trafficmanager.net/amer/",
"from": {
"id": "29:1kCq75A-g8wVc36XZqhI504r073ByA0Uk0KMcIAIWMvrm_2iivPfbNZ5mDObiz_gFfmkcf2hioAZO5NfG_mfiRw",
"name": "Anthony Andriano",
"aadObjectId": "2402b3bf-99b7-4979-9970-6ad9528a3ba7"
},
"conversation": {
"conversationType": "personal",
"tenantId": "bcd4c429-1111-1111-1111-111111111111",
"id": "a:1EhVX34pEmKNtjGyIVdtjAJiH6UgENmFZaHECCBGLe0bpNFOytjc3VHDfRTbknG8pDliFTZfwXP4IXyCM8tftZvvVgZ_OBdXuJj5nSd6i22c_C7s8qm3uOYqxVN4GEpQB"
},
"recipient": {
"id": "28:2cf61cbd-a711-4f9f-95b4-92a7b20cb017",
"name": "CometDev"
},
"entities": [
{
"locale": "en-US",
"country": "US",
"platform": "Web",
"timezone": "America/Denver",
"type": "clientInfo"
}
],
"channelData": {
"tenant": {
"id": "bcd4c429-1111-1111-1111-111111111111"
},
"source": {
"name": "compose"
}
},
"value": {
"commandId": "info",
"parameters": [
{
"name": "initialRun",
"value": "true"
}
],
"queryOptions": {
"count": 25,
"skip": 0
}
},
"locale": "en-US",
"localTimezone": "America/Denver",
"receivedAt": "2023-05-12 20:44:55",
"parent": {
"id": "60e77309b0a75b5b2",
"type": "User"
}
}
]
I still need to know which endpoint to send the response to as well as how the JSON should be structured.
@bandtank - Apologies. Currently there is no update to share. However, we are constantly following up with engineering team on this. We will inform you once we get any update. Thanks!
The documentation does not say how to respond to extension search or action requests. It is assumes the SDK will be used and the implementation details are hidden as a result.
Here is an incoming request from a search extension with a few fake values:
Sending a response with the following attributes results in an error:
The error:
It seems like the problem is related to the
/activities
route. The documentation does not say which route to use or how to find it. This problem may also be related to the verb. I assumePOST
should be used, but I have encountered other errors when using the Teams APIs whenPOST
was used instead ofPUT
, which the documentation did not specify.Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.