Search code examples
azurebotframeworkmicrosoft-teamsazure-bot-servicerest

Reply to message as threaded response in MS Teams using Azure Bot Sevices


I have been referring to docs like this and this to send a reply to a proactive message as threaded message.

But, I am only able to send each message as independent message and not as reply message.

I want to have a reply like this: enter image description here

I am pretty sure the channel allows reply, since the screenshot is from the channel itself.

My request payload : URL:https://smba.trafficmanager.net/amer/v3/conversations/{conversationId}/activities/{activityId} Method: POST

{
  "type": "message",
  "from": {
    "id": "bot-id",
    "name": "bot name"
  },
  "conversation": {
    "id": "19:channelId",
    "name":"random name"
  },
   "recipient": {
        "id": "recepientId",
        "name": "name"
    },
  "text":"I want to reply to threadid",
  "replyToId":"{activityId}"
}

This is supposed to be very simple, but I am struggling to find what I am doing wrong. Any help is appreciated.


Solution

  • I used the URL Like this:

    https://smba.trafficmanager.net/amer/v3/conversations/{channelId;messageid={activityId}/activities
    

    and it worked like a charm!