Skip to content

eDiscovery Operation return values should include data from Location header #1396

Closed

Description

Describe the bug

Some of the eDiscovery APIs return the Operation information in the Location header, but the SDK is not returning this information.

this makes it nearly impossible to track the status of the Operation, because you don't know which operation to track.

the code should be updated to at minimum return the Location header info, or ideally to simply return the Operation ID.

Expected behavior

The SDK endpoints that create an eDiscovery operation should return the operation id.

How to reproduce

Follow the code snippets in the docs:

# 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_export_result.export_result_post_request_body import ExportResultPostRequestBody
from msgraph.generated.models.export_criteria import ExportCriteria
from msgraph.generated.models.additional_options import AdditionalOptions
from msgraph.generated.models.export_format import ExportFormat
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ExportResultPostRequestBody(
	display_name = "Export 1 - simple PST",
	export_criteria = ExportCriteria.SearchHits,
	additional_options = AdditionalOptions.HtmlTranscripts | AdditionalOptions.SplitSource | AdditionalOptions.IncludeFolderAndPath | AdditionalOptions.CondensePaths | AdditionalOptions.FriendlyName,
	export_format = ExportFormat.Pst,
)

await graph_client.security.cases.ediscovery_cases.by_ediscovery_case_id('ediscoveryCase-id').searches.by_ediscovery_search_id('ediscoverySearch-id').microsoft_graph_security_export_result.post(request_body)

(although most of them are broken)

SDK Version

1.45.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Activity

  1. ramsessanchez commented on Apr 20, 2026

    @ramsessanchez
    Contributor

    Hi Alan Hinchliff (@hinchliff)
    Could you try the following?

    2. Standard API Calls — This library delegates to Kiota (HttpxRequestAdapter from kiota_http). The send_async()
    method deserializes responses into Parsable models directly, so response headers are not exposed by default in the
    returned model objects.
    
    To access raw response headers, you'd use Kiota's NativeResponseHandler pattern:
    
     from kiota_abstractions.native_response_handler import NativeResponseHandler
     from kiota_abstractions.request_option import RequestOption
     
     handler = NativeResponseHandler()
     request_config.options = [handler]
     # After the call, handler.value is the raw httpx.Response
     # handler.value.headers gives you the response headers
    
    This library itself doesn't add any custom response-header handling beyond what Kiota and the BatchResponseItem
    class provide. If you need headers from a regular Graph call, you'd need to go through Kiota's native response
    handler mechanism.
    
  2. microsoft-github-policy-service commented on Apr 27, 2026

    @microsoft-github-policy-service

    This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions