Home > OS >  Is there a way to get the statistics of data in legal hold through graph API?
Is there a way to get the statistics of data in legal hold through graph API?

Time:05-10

I am currently working on eDiscovery enter image description here

Can we get the statistics from below through any graph API ?

CodePudding user response:

Is there a way to get the statistics of data in legal hold through graph API?

Yes, you can get the statistics of data in legal hold through the below graph API:

GET /compliance/ediscovery/cases/{caseId}/legalHolds

By using this API, you can Get the legalHolds that are applied to a case.

You must have Delegated (work or school account) permissions to call this API.

Example:

GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var legalHolds = await graphClient.Compliance.Ediscovery.Cases["{ediscovery.case-id}"].LegalHolds
    .Request()
    .GetAsync();

If successful, this method returns a 200 OK response code and a collection of legalHold objects in the response body.

Note: Do not supply a request body for this method.

CodePudding user response:

If you know legalHold id you can use the ID of legalHold resource for the eDiscovery case.

You can call

GET /compliance/ediscovery/cases/{caseId}/sourceCollections

var sourceCollections = await graphClient.Compliance.Ediscovery.Cases["{ediscovery.case-id}"].SourceCollections
    .Request()
    .GetAsync();

to get list of sourceCollection.

For each sourceCollection you can run an estimate of the number of emails and documents in the source collection

POST /compliance/ediscovery/cases/{caseId}/sourceCollections/{sourceCollectionId}/estimateStatistics

await graphClient.Compliance.Ediscovery.Cases["{caseId}"].SourceCollections["{sourceCollectionId}"]
.EstimateStatistics()
.Request()
.PostAsync();

The response will contain a Location header, which contains the location of the estimateStatisticsOperation that was created to handle the estimate.

Or you can get the last estimateStatisticsOperation object associated with a source collection.

GET /compliance/ediscovery/cases/{caseId}/sourceCollections/{sourceCollectionId}/lastEstimateStatisticsOperation

var estimateStatisticsOperation = await graphClient.Compliance.Ediscovery.Cases["{caseId}"].SourceCollections["{sourceCollectionId}"].LastEstimateStatisticsOperation
.Request()
.GetAsync();

estimateStatisticsOperation contains the properties status, siteCount, mailboxCount, indexedItemCount, indexedItemsSize, unindexedItemCount and unindexedItemsSize.

  • Related