How to send a message to a thread (reply) using botbuilder 4.0 SDK

Copper Contributor

How to send a message to a thread (reply) using botbuilder 4.0 SDK

Scenario:-
1. User A -> Types a message in Teams App (bot)
2. Now Bot has to reply to the same thread that user A has started in Teams App (bot)

I am able to send a new message in the Teams App (bot) - Not expected

NOT EXPECTEDNOT EXPECTED
The bot needs to reply to the same thread the user started -  Expected
EXPECTEDEXPECTED


If you have any document link or example, please point it out. 

Thank you.

14 Replies
@ituser1n03v - Thanks for reporting your issue. We are checking this internally. We will update you soon.

@ituser1n03v
To reply to an existing message, call ReplyToActivity in .NET or session.send in Node.js. The Bot Builder SDK handles all the details.

If you choose to use the REST API, you can also call the /v3/conversations/{conversationId}/activities/{activityId} endpoint.

Ref Doc: https://learn.microsoft.com/en-us/microsoftteams/platform/resources/bot-v3/bot-conversations/bots-co...

Thanks, 

Nivedipa

----------------------------------------------------------------------------------

If the response is helpful, please click "Mark as Best Response" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.




@Nivedipa-MSFT 

I am using Nodejs and clicking on 'session.send'  take me to a page where there is no reference to it.
 
The requested page is not available for Bot Builder Typescript SDK 3.0. You have been redirected to the newest product version this page is available for.

@Nivedipa-MSFT 

REST API is also not working... getting service error
Screenshot 2023-01-17 at 6.18.44 PM.png

@ituser1n03v
Session.send is not available for Bot Builder Typescript SDK 3.0.
We will test the REST API and update you soon.

@Nivedipa-MSFT 

I think you meant "Session.send" is not available for Bot Builder Typescript SDK 4.0.

@ituser1n03v - You have used wrong service URL.
In your screenshots I have seen the service URL is https://smba.trafficmanager.net/apac.
You have used the https://smba.trafficmanager.net/apis.

Please use correct service URL and check again?

We have tested using REST API. But this one is not look like as reply.

NivedipaMSFT_0-1674122879432.png


This is by design behaviour. 
You can suggest this feature here: Microsoft Teams Community

Using https://smba.trafficmanager.net/apac error is gone and API is 201 but the message is going as a new message as you confirmed and not as a reply.

As per your suggestion, I have requested the feature here: https://techcommunity.microsoft.com/t5/teams-developer/how-to-send-a-message-to-a-thread-reply-using...
Expected behaviour is not achieved in both ReplyToActivity and REST API.
@aimantahir1225 - There is an already feature request raised for this issue.

@Nivedipa-MSFT is there any updates regarding this feature?

Unfortunately, we do not have any update to share. Please track the feature request link posted above for further updates.

https://feedbackportal.microsoft.com/feedback/idea/e63a7768-ed97-ed11-a81b-6045bdaf6a9e