box / box-windows-sdk-v2

Windows SDK for v2 of the Box API. The SDK is built upon .NET Framework 4.5

Home Page:https://developer.box.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to retrieve folder contents sorted by date

daren09 opened this issue · comments

Note that retrieving contents sorted by name works using;
var items = await appUserClient.FoldersManager.GetFolderItemsAsync(FolderId, 500,0, responeParam, false, BoxSortBy.Name.ToString(), BoxSortDirection.DESC);

I am using the following to retrieve the content of a specific folder sorted by date;

var items = await appUserClient.FoldersManager.GetFolderItemsAsync(FolderId, 500,0, responeParam, false, BoxSortBy.interacted_at.ToString(), BoxSortDirection.DESC);
and I get the below error;

Error Details;

Box.V2.Exceptions.BoxException
HResult=0x80131500
Message=The API returned an error [BadRequest | wcapwmglgn74olg4.03e565b5abf906c7165cc9e64c71e2c2f] bad_request - Bad Request
Source=Box.V2.Core
StackTrace:
at Box.V2.Extensions.BoxResponseExtensions.ParseResults[T](IBoxResponse1 response, IBoxConverter converter) at Box.V2.Managers.BoxResourceManager.<ToResponseAsync>d__111.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 Box.V2.Managers.BoxFoldersManager.<GetFolderItemsAsync>d__2.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 ConsoleApp1.Program.

d__0.MoveNext() in C:\Visual Studio Projects\ConsoleApp2\ConsoleApp1\ConsoleApp1\Program.cs:line 37

This exception was originally thrown at this call stack:
[External Code]
ConsoleApp1.Program.Main(string[]) in Program.cs

Having the same issue.
Would also like to sort by size, modified_at or created_at if possible.

commented

This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.

commented

This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box .NET SDK and feel free to open another PR/issue at any time.