Forum Discussion

FabienVicente's avatar
FabienVicente
Copper Contributor
Feb 25, 2025

Replies not included when retrieving messages using GraphApi

Hi Team,
We've noticed that when we retrieve a message using the Get chatMessage in a channel or chat Api for a message that is a reply to another message we are missing an attachment. This only happens to message that are sent by a Teams bot. These attachments used to always be present for replies but now are missing.

Steps to reproduce


Start the Echo bot from the sample templates (I used Teams Toolkit to deploy it to Teams or run it in the Test tool). In addition, I followed the following tutorialto add the graph Api to my bot. 
Give the permission ChatMessage.Read.All to the application created by the Teams Toolkit.
In the graphHelper.ts file, add the following function:

export async function getMessage(conversationId: string, messageId: string) : Promise<any> {
return _appClient.api('/chats/'+conversationId+'/messages/'+messageId)
.get();
}

 

In the TeamsBot.ts file, modify the onMessage function by replacing await context.sendActivity(...) with the following code.  

const message = await getMessage("19:email address removed for privacy reasons.spaces", context.activity.id);
if (message.attachments.length == 0) {
  await context.sendActivity("No reply message found");
} else {
  await context.sendActivity("Reply message found<br/>" + message.attachments[0].content);
}


Note: For simplicity the conversation Id is hard coded with the one used for my tests here


Observed behaviour:

 

First case: Message with no reply


We don't receive any attachment as expect because this not a reply message.


Second case: Message that replies to my own message.

 

We receive an attachment as expected because this is a reply message

Third case: Message that replies to a bot message


We don't receive any attachment. This is unexpected as this is a message reply.

 

The third case is surprising to us as it used to work the same way as the second case but now we get an inconsistent behaviour. Can you advise if this is an expected behaviour ? Is there a workaround to simply parse message replies ?

Thank you !

  • Hi FabienVicente

    Thanks for raising your issue. We are able to repro this issue and have raised a bug for the same. We will inform you once we get any further update from engineering team.

Resources