Microsoft Teams API: Filtering channel messages by date

2021-08-16T11:05:54.067+00:00

Hi,

I know some of the existing Microsoft API-s support the $filter query, which allows me to, for example, filter data based on the create/send/receive (etc.) timestamps.

I am in need of doing something similar for Microsoft Teams. More specifically, I'd like to filter by createdDateTime. For example, I could query: ...channels/<id>/messages/<id>?$filter=(createdDateTime ge 2015-02-12T18:58:01.624Z and createdDateTime le 2020-07-31T18:58:01.624Z).

I'd like to know if this query parameter will be introduced at all, and when if so.

Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Ramjot Singh 861 Reputation points Microsoft Employee
    2021-08-16T18:20:30.043+00:00

    You can use https://learn.microsoft.com/en-us/graph/api/chatmessage-delta?view=graph-rest-beta&tabs=http and have a filter on lastModifiedTime to get similar behavior and then stop once you have reached the time where you want to stop. The order in this API is oldest to newest instead of newest to oldest.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.