I'm currently using the Microsoft Graph API to develop an app. I use .0/search/query to search for messages. I receive the results, which include both the original message (1) and reply message(2).
this is the message example in teams, it has the message and the reply
message in teams
when I search using search/query it will return this data:
[
{
"hitId": "...",
"rank": 1,
"summary": "xsxsxs",
"resource": {
"@odata.type": "microsoft.graph.chatMessage",
"id": "xxxxx73046",
"createdDateTime": "...",
"lastModifiedDateTime": "...",
"subject": "",
"importance": "normal",
"webLink": "...",
"from": "...",
"channelIdentity": "...",
"etag": "xxxxx73046",
"chatId": "..."
}
},
{
"hitId": "...",
"rank": 2,
"summary": "xsxsxs",
"resource": {
"@odata.type": "microsoft.graph.chatMessage",
"id": "xxxxxxxx9209",
"createdDateTime": "...",
"lastModifiedDateTime": "...",
"subject": "",
"importance": "normal",
"webLink": "...",
"from": "...",
"channelIdentity": "...",
"etag": "xxxxxxxx9209",
"chatId": "..."
}
}
]
the first one is main message and the second one is a reply of the main message. I will display this on my app and add onclick functionality to get detail message using /teams/{team-id}/channels/{channel-id}/messages/{message-id} api.
Using the first data resource.id is returning success and I get the message detail because it is a main message, but using the second data resource.id is returning 404 because it's a reply of main message.
Does this mean I need to obtain the main message ID from the reply? Is there any API or practical way I can use to retrieve it?
I've tried utilizing this api and filter by date .0&tabs=http and it works, but I'm wondering if there's any other better solution.