Search code examples
microsoft-graph-api

When using MSGaraph API to get messages from channel it returns me all the messages including deleted one


When using MS graph API to get messages from a channel, it gives the list of messages including the deleted one. Is there a way to filter it?

https://graph.microsoft.com/v1.0/teams//channels//messages?$top=50


Solution

  • Server side filtering of channel message is not supported. Only supported query parameters are $top and $expand.

    Client side filtering seems to be not good option right now because according this issue deletedDateTime property is null for deleted messages (probably due to a bug), so you can't find out whether the message was deleted or not.

    Resources:

    Query parameters