POST https://graph.microsoft.com/v1.0/security/cases/ediscoveryCases/b0073e4e-4184-41c6-9eb7-8c8cc3e2288b/searches/c61a5860-d634-4d14-aea7-d82b6f4eb7af/purgeData
{
"purgeType": "recoverable",
"purgeAreas": "teamsMessages"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Security.Cases.EdiscoveryCases.Item.Searches.Item.MicrosoftGraphSecurityPurgeData;
using Microsoft.Graph.Models.Security;
var requestBody = new PurgeDataPostRequestBody
{
PurgeType = PurgeType.Recoverable,
PurgeAreas = PurgeAreas.TeamsMessages,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Security.Cases.EdiscoveryCases["{ediscoveryCase-id}"].Searches["{ediscoverySearch-id}"].MicrosoftGraphSecurityPurgeData.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphsecurity "github.com/microsoftgraph/msgraph-sdk-go/security"
graphmodelssecurity "github.com/microsoftgraph/msgraph-sdk-go/models/security"
//other-imports
)
requestBody := graphsecurity.NewPurgeDataPostRequestBody()
purgeType := graphmodels.RECOVERABLE_PURGETYPE
requestBody.SetPurgeType(&purgeType)
purgeAreas := graphmodels.TEAMSMESSAGES_PURGEAREAS
requestBody.SetPurgeAreas(&purgeAreas)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Security().Cases().EdiscoveryCases().ByEdiscoveryCaseId("ediscoveryCase-id").Searches().ByEdiscoverySearchId("ediscoverySearch-id").MicrosoftGraphSecurityPurgeData().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.security.cases.ediscoverycases.item.searches.item.microsoftgraphsecuritypurgedata.PurgeDataPostRequestBody purgeDataPostRequestBody = new com.microsoft.graph.security.cases.ediscoverycases.item.searches.item.microsoftgraphsecuritypurgedata.PurgeDataPostRequestBody();
purgeDataPostRequestBody.setPurgeType(com.microsoft.graph.models.security.PurgeType.Recoverable);
purgeDataPostRequestBody.setPurgeAreas(EnumSet.of(com.microsoft.graph.models.security.PurgeAreas.TeamsMessages));
graphClient.security().cases().ediscoveryCases().byEdiscoveryCaseId("{ediscoveryCase-id}").searches().byEdiscoverySearchId("{ediscoverySearch-id}").microsoftGraphSecurityPurgeData().post(purgeDataPostRequestBody);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Security\Cases\EdiscoveryCases\Item\Searches\Item\MicrosoftGraphSecurityPurgeData\PurgeDataPostRequestBody;
use Microsoft\Graph\Generated\Models\Security\PurgeType;
use Microsoft\Graph\Generated\Models\Security\PurgeAreas;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new PurgeDataPostRequestBody();
$requestBody->setPurgeType(new PurgeType('recoverable'));
$requestBody->setPurgeAreas(new PurgeAreas('teamsMessages'));
$graphServiceClient->security()->cases()->ediscoveryCases()->byEdiscoveryCaseId('ediscoveryCase-id')->searches()->byEdiscoverySearchId('ediscoverySearch-id')->microsoftGraphSecurityPurgeData()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.security.cases.ediscoverycases.item.searches.item.microsoft_graph_security_purge_data.purge_data_post_request_body import PurgeDataPostRequestBody
from msgraph.generated.models.purge_type import PurgeType
from msgraph.generated.models.purge_areas import PurgeAreas
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = PurgeDataPostRequestBody(
purge_type = PurgeType.Recoverable,
purge_areas = PurgeAreas.TeamsMessages,
)
await graph_client.security.cases.ediscovery_cases.by_ediscovery_case_id('ediscoveryCase-id').searches.by_ediscovery_search_id('ediscoverySearch-id').microsoft_graph_security_purge_data.post(request_body)