Missing GetDownloadUrl method for CaseExportOperation
The Microsoft Documentation indicates to use the GetDownloadUrl like this:
var @string = await graphClient
.Compliance
.Ediscovery
.Cases["{ediscovery.case-id}"]
.Operations["{ediscovery.caseOperation-id}"]
.GetDownloadUrl()
.Request()
.GetAsync();
However, the GetDownloadUrl is not available.

Expected behavior It's expected to have GetDownloadUrl method
Client version Microsoft.Graph version 4.9.0-preview
Hey @oliveira-alexdias. Thanks for bringing this up! This issue is because the SDK currently doesn't support OData cast. We have plans to fix this in early 2022.
As a workaround, you can use BaseRequest to access the GetDownloadUrl method as follows:
var requestUrl = graphClient
.Compliance
.Ediscovery
.Cases["{ediscovery.case-id}"]
.Operations["{ediscovery.caseOperation-id}"]
.AppendSegmentToRequestUrl("microsoft.graph.ediscovery.caseExportOperation/getDownloadUrl");
var request = new BaseRequest(requestUrl, graphClient);
var response = await request.SendAsync<ODataMethodStringResponse>(null, CancellationToken.None);
var @string = response.Value;
Hope this can help.
Hey @maisarissi I believe there is an issue in Download URL functionality. Either getting the Download URL through this workaround you gave me or getting the Download URL through HTTP call it is returning a 500 Internal Server Error.
Could you please check it?
- Using the workaround
var client = await graph.GetROPCClient(Scopes.Default);
var requestUrl = client
.Compliance
.Ediscovery
.Cases[aedCaseId.ToString()]
.Operations[aedExportId]
.AppendSegmentToRequestUrl("microsoft.graph.ediscovery.caseExportOperation/getDownloadUrl");
var request = new BaseRequest(requestUrl, client);
var response = await request.SendAsync<ODataMethodStringResponse>(null, CancellationToken.None);
return response.Value;
-
Message: Code: InternalServerError Message: An unexpected error occurred. Inner error: AdditionalData: date: 2021-12-14T18:35:56 request-id: f79c42c4-d465-4624-9c37-d4bc19cd910c client-request-id: f79c42c4-d465-4624-9c37-d4bc19cd910c ClientRequestId: f79c42c4-d465-4624-9c37-d4bc19cd910c
-
e.StackTrace: at Microsoft.Graph.HttpProvider.<SendAsync>d__18.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable
1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Graph.BaseRequest.<SendRequestAsync>d__40.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Graph.BaseRequest.<SendAsync>d__341.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Exports.Services.<GetDownloadUriForBrowserDownload>d__27.MoveNext() in .\Functions\Exports\Services\GetDownloadUrl.cs:line 52 -
Using HTTP Call

@mahage-msft can you take a look at this? Since the error is also happening in the Graph Explorer doesn't sound like an SDK error. There is also this question in the Q&A: https://docs.microsoft.com/en-us/answers/questions/666906/getdownloadurl-api-method-no-longer-working.html
Hi @oliveira-alexdias . Are you still getting 500 using the workaround provided above?
Hey @maisarissi! Now it is working as expected. Thank you.
Great to hear @oliveira-alexdias .
I'll keep this issue open to track the OData cast fix so we can have the GetDownloadUrl as part of the Fluent API. Thank you!
This is currently not showing up on the OpenAPI reference metadata due to the conversion library limiting child paths on derived/odata cast paths. Currently tracked via https://github.com/microsoft/OpenAPI.NET.OData/issues/269