Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing GetDownloadUrl method for CaseExportOperation #338

Open
oliveira-alexdias opened this issue Aug 25, 2021 · 7 comments
Open

Missing GetDownloadUrl method for CaseExportOperation #338

oliveira-alexdias opened this issue Aug 25, 2021 · 7 comments
Labels
Bug: metadata Kiota Is solved by Kiota or will be addressed in Kiota OpenApi
Milestone

Comments

@oliveira-alexdias
Copy link

oliveira-alexdias commented Aug 25, 2021

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.

error

AB#10865

Expected behavior
It's expected to have GetDownloadUrl method

Client version
Microsoft.Graph version 4.9.0-preview

@ghost ghost added the Needs: Triage label Aug 25, 2021
@maisarissi
Copy link

maisarissi commented Oct 27, 2021

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.

@maisarissi maisarissi added Bug Something isn't working OData-cast and removed Needs: Triage labels Oct 27, 2021
@oliveira-alexdias
Copy link
Author

oliveira-alexdias commented Dec 14, 2021

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.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.ConfiguredTaskAwaitable1.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.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.d__27.MoveNext() in .\Functions\Exports\Services\GetDownloadUrl.cs:line 52

  • Using HTTP Call
    image

@maisarissi
Copy link

maisarissi commented Jan 5, 2022

@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

@maisarissi
Copy link

Hi @oliveira-alexdias .
Are you still getting 500 using the workaround provided above?

@maisarissi maisarissi added the Kiota Is solved by Kiota or will be addressed in Kiota label Mar 8, 2022
@oliveira-alexdias
Copy link
Author

Hey @maisarissi! Now it is working as expected. Thank you.

@maisarissi maisarissi reopened this Mar 9, 2022
@maisarissi
Copy link

maisarissi commented Mar 9, 2022

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!

@andrueastman
Copy link
Member

andrueastman commented Aug 30, 2022

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 microsoft/OpenAPI.NET.OData#269

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: metadata Kiota Is solved by Kiota or will be addressed in Kiota OpenApi
Projects
None yet
Development

No branches or pull requests

3 participants