Share via

Getting an odata error while making request to microsoft graph rest api beta

Journaling 365 1 Reputation point
2025-11-13T07:23:00.57+00:00

While making a request to graph client on below mentioned endpoints i am getting an ODataError

await graphClient.Security.Cases.EdiscoveryCases["{ediscoveryCase-id}"].ReviewSets["{ediscoveryReviewSet-id}"].Files.GetAsync()
 await graphClient.Security.Cases.EdiscoveryCases["{ediscoveryCase-id}"].Searches["{ediscoverySearch-id}"].PatchAsync(null);

other than this mention endpoints, getting an error while i try to request next page of files using odata.nextLink from review set while fetching batch of files

[ERROR] 111125 09:56:35.02, [49412_154]-Microsoft.Graph.Beta.Models.ODataErrors.ODataError: An unexpected error occurred.

at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.ThrowIfFailedResponseAsync(HttpResponseMessage response, Dictionary`2 errorMapping, Activity activityForAttributes, CancellationToken cancellationToken)

at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType]

at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType]

at Microsoft.Graph.Beta.Security.Cases.EdiscoveryCases.Item.ReviewSets.Item.Files.FilesRequestBuilder.GetAsync(Action`1 requestConfiguration, CancellationToken cancellationToken)

i have provided alse User.read and User.Read.All Api permissions

Microsoft Security | Microsoft Graph
0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2025-11-13T07:23:27.7766667+00:00

    The OData error you are encountering while making requests to the Microsoft Graph API can be attributed to several potential issues. Here are some steps you can take to troubleshoot the problem:

    1. Check Permissions: Ensure that the permissions you have granted (User.read and User.Read.All) are sufficient for the operations you are trying to perform. You may need additional permissions specific to the Security and eDiscovery functionalities.
    2. Validate IDs: Double-check that the {ediscoveryCase-id}, {ediscoveryReviewSet-id}, and {ediscoverySearch-id} you are using in your requests are valid and exist in your environment.
    3. Examine the Request URL: Ensure that the URL you are using for the request is correctly formatted and that the endpoint is accessible. The $skiptoken parameter should also be valid and correctly implemented for pagination.
    4. Handle Conditional Access Policies: If your organization has Conditional Access policies in place, ensure that the user making the request complies with these policies. If not, you may receive errors related to insufficient claims or interaction required.
    5. Review API Documentation: Consult the Microsoft Graph API documentation for the specific endpoints you are using to ensure that you are following the correct syntax and usage patterns. This can help identify if there are any changes or requirements that you may have missed.
    6. Check for Service Issues: Sometimes, the issue may be related to service disruptions or bugs in the beta version of the API. Check the Microsoft Graph status page or forums for any known issues.

    If the problem persists after checking these areas, consider reaching out to Microsoft support for further assistance, providing them with the exact error message and context of your requests.

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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