Issues trying to delete chat messages in Teams in Graph

Stanley Nichols 0 Reputation points
2024-10-24T12:46:04.2133333+00:00

I am attempting to search and delete a message in Microsoft Teams, I have found a procedure document from Microsoft that shows how to do it via the Purview Portal and Graph Explorer here, a cumbersome process to say the least, I get to the step where it has you run the POST request using this, while replacing my values with the correct id's.

https://graph.microsoft.com/v1.0/security/cases/ediscoveryCases/{ediscoveryCaseID}/searches/{ediscoverySearchID}/purgeData

When I Run Query I am presented with an error that states: "PurgeType and PurgeArea parameters must be specified.", now here is where I am confused, when referencing the sourceCollection: purgeData documentation

it specifically states::

Request body

Don't supply a request body for this method.Request body Don't supply a request body for this method.

Only when I provide the following arguments in the Request Body do I get a Acccepted Query:

{

  "purgeType": "recoverable",

  "purgeAreas": "teamsMessages"

}

The issue is the message is still there, it has been about 48 hours and I am not seeing any retention policies enabled, apart from the ones I have disabled. I am seeing a few threads on here but with no definite answer.

Has anyone done this before and is able to point me in the right direction?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,554 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,653 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,442 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Sayali-MSFT 3,226 Reputation points Microsoft Vendor
    2024-10-25T11:44:40.9166667+00:00

    Hi @Stanley Nichols- When you make the POST request, the body should look like this:

    
    {
    

    Note that purgeAreas should be an array.


  2. Stanley Nichols 0 Reputation points
    2024-10-25T11:59:37.7133333+00:00

    @Sayali-MSFT

    So when I provide the following:

    {

    "purgeType": "recoverable",

    "purgeAreas": ["teamsMessages"]

    }

    Parameter PurgeAreas does not accept collection values.


  3. Motasem Ismail 0 Reputation points Microsoft Employee
    2024-12-19T13:31:04.7433333+00:00

    Thanks for posting this question, you should be able to post this action by adding the the Request body:

    {
    
    "purgeType": "recoverable",
    
    "purgeAreas": "teamsMessages"
    
    }
    

    User's image

    0 comments No comments

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.