最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to get teams channel message from reply message id in ms graph? - Stack Overflow

programmeradmin2浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论