box-windows-sdk-v2: SearchManager.QueryAsync throwing error C# SDK

When calling below method it is giving error. “The API returned an error [BadRequest | pidgc8gv4igelb3i.0973aae7b72f661c48bff8d457adb46a0] bad_request - Bad Request”

var task = Task.Run(async () =>
{
var fields = new List<string>
{
BoxItem.FieldParent,
BoxItem.FieldName,
BoxItem.FieldSize,
BoxItem.FieldCreatedBy,
BoxItem.FieldCreatedBy,
BoxItem.FieldPathCollection,
BoxFolder.FieldCreatedBy,
BoxFolder.FieldPathCollection,
BoxFolder.FieldItemCollection,
BoxFolder.FieldSyncState
};

return await userClient.SearchManager.QueryAsync(query: searchKeyword, fields: fields, type: "folder");
});

return task.Result.Entries ?? new List<BoxItem>();

Rest all methods working good.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 34 (15 by maintainers)

Most upvoted comments

@antusus This seems to be working fine, but still keep it open will update you by tomorrow.