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> </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": []
}
]
}