0

I used Microsoft Teams' message acquisition API. It was able to get all the messages so far. However, since yesterday, suddenly I can no longer get the messages I have received so far. Is this a bug?

Messages from yesterday and later can be obtained with the API. If you look at the chat of the corresponding team in the client application of Teams, the past messages remain from yesterday.

This is the API I'm using

GET /teams/{id}/channels/{id}/messages

=====================20190904 Postscript=====================

I took a capture. This is the Teams application screen. You can see that there are at least 4 conversations on the first page. And 8/26 messages are lined up. enter image description here

The second page confirms that there is a conversation that can be acquired with the API. enter image description here

Then use the same account to use Graph Explorer. The result of executing the message acquisition API is described. (id is hidden.)

Only 3 messages are returned. Even if nextLink is accessed, 0 items will be returned.

{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#teams('teamid')/channels('channelid')/messages",
"@odata.count": 3,
"@odata.nextLink": "https://graph.microsoft.com/beta/teams/teamid/channels/channelid/messages?$skiptoken=token",
"value": [
    {
        "id": "id",
        "replyToId": null,
        "etag": "etagid",
        "messageType": "message",
        "createdDateTime": "2019-08-02T05:44:27.892Z",
        "lastModifiedDateTime": "2019-08-02T06:28:57.101Z",
        "deletedDateTime": null,
        "subject": "重要",
        "summary": null,
        "importance": "high",
        "locale": "en-us",
        "webUrl": "https://teams.microsoft.com/l/message/channelid/id?groupId=teamid&tenantId=tenantid&createdTime=1564724667892&parentMessageId=id",
        "policyViolation": null,
        "from": {
            "application": null,
            "device": null,
            "conversation": null,
            "user": {
                "id": "userid",
                "displayName": "Hoshi, Rikito (ゲスト)",
                "userIdentityType": "aadUser"
            }
        },
        "body": {
            "contentType": "html",
            "content": "<div><div>\n<div>\n<div>会話がすべて消えてしまったので再投稿します。</div>\n\n<div>以下の内容を必ず読んでおいてください。</div>\n\n<div>&nbsp;</div>\n\n\n<div itemprop=\"copy-paste-block\">TESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTEST</div>\n</div>\n</div>\n</div>"
        },
        "attachments": [],
        "mentions": [],
        "reactions": []
    },
    {
        "id": "id",
        "replyToId": null,
        "etag": "etagid",
        "messageType": "message",
        "createdDateTime": "2019-09-03T08:16:40.73Z",
        "lastModifiedDateTime": null,
        "deletedDateTime": null,
        "subject": "APIで取れなくなってから投稿",
        "summary": null,
        "importance": "normal",
        "locale": "en-us",
        "webUrl": "https://teams.microsoft.com/l/message/channelid/etagid?groupId=teamid&tenantId=tenantid&createdTime=1567498600730&parentMessageId=id",
        "policyViolation": null,
        "from": {
            "application": null,
            "device": null,
            "conversation": null,
            "user": {
                "id": "userid",
                "displayName": "TalkMap",
                "userIdentityType": "aadUser"
            }
        },
        "body": {
            "contentType": "text",
            "content": "テスト"
        },
        "attachments": [],
        "mentions": [],
        "reactions": []
    },
    {
        "id": "id",
        "replyToId": null,
        "etag": "etagid",
        "messageType": "message",
        "createdDateTime": "2019-09-02T05:17:51.671Z",
        "lastModifiedDateTime": null,
        "deletedDateTime": null,
        "subject": "",
        "summary": null,
        "importance": "normal",
        "locale": "en-us",
        "webUrl": "https://teams.microsoft.com/l/message/channelid/etagid?groupId=teamid&tenantId=tenantid&createdTime=1567401471671&parentMessageId=id",
        "policyViolation": null,
        "from": {
            "application": null,
            "device": null,
            "conversation": null,
            "user": {
                "id": "userid",
                "displayName": "TalkMap",
                "userIdentityType": "aadUser"
            }
        },
        "body": {
            "contentType": "html",
            "content": "<div>タブを追加し、会話を開始しました。</div><attachment id=\"tab::71cf5160-ec4f-4b06-b334-62f3759a7de8\"></attachment>"
        },
        "attachments": [
            {
                "id": "tab::id",
                "contentType": "tabReference",
                "contentUrl": null,
                "content": null,
                "name": "TalkMap",
                "thumbnailUrl": null
            }
        ],
        "mentions": [],
        "reactions": []
    }
]

}

rikito
  • 1
  • 2
  • 2
    I believe you should report this as an issue to Microsoft Teams support – Riddell Sep 03 '19 at 08:04
  • [List channel messages](https://learn.microsoft.com/en-us/graph/api/channel-list-messages?view=graph-rest-beta&tabs=http) graph API is under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. – Trinetra-MSFT Sep 03 '19 at 09:27
  • @rikito- It is working fine for me as well. Could you please share some screenshot where message is present in channel but not in Graph API response? – Wajeed Shaikh Sep 03 '19 at 13:47
  • Thank you for your comments. Added the capture and API execution results to the question. I know this is not supported, but I am very interested in this API. By the way, we built a web app that implements the Teams message acquisition API and added it to the Teams tab. Although not immediately, this event occurred that day. – rikito Sep 04 '19 at 01:49
  • @rikito- Sorry for delay. Are you still facing this issue? Could you try it once more and share teamId and channelId along with the updated response? – Wajeed Shaikh Oct 07 '19 at 03:34

1 Answers1

0

I don't see the same behavior from my side. It works fine.

Based on your description, it should be not a general issue, but a problem with the backend services of Microsoft Teams.

If you have followed Send feedback about the Microsoft Teams developer platform but get no help, it's strongly recommended to contact O365 admin support for further investigation.

Allen Wu
  • 15,529
  • 1
  • 9
  • 20
  • thank you for your answer. I felt relieved because it seemed to happen only to me. contact Contact O365 admin support. When I asked before, I was told that I couldn't answer about API. :_( – rikito Sep 04 '19 at 02:00