Search for content API | Direction and Sort Field is not working as expected
Hi Team,
We are trying to implement the get-search API and passing the sort=modified_at&direction=ASC in URL but not getting the sort data also if I tried by passing direction as DESC then also getting the response in the same order.
Request URL: https://api.box.com/2.0/search?file_extensions=java,txt,csv&query=f&sort=modified_at&direction=ASC
Response:
{
"total_count": 4,
"entries": [
{
"type": "file",
"id": "763588855519",
"file_version": {
"type": "file_version",
"id": "814427942719",
"sha1": "21d19c2ba8f06a30a464f308fe732e0d5321aa98"
},
"sequence_id": "0",
"etag": "0",
"sha1": "21d19c2ba8f06a30a464f308fe732e0d5321aa98",
"name": "demo-file2.csv",
"description": "",
"size": 96,
"path_collection": {
"total_count": 1,
"entries": [
{
"type": "folder",
"id": "0",
"sequence_id": null,
"etag": null,
"name": "All Files"
}
]
},
"created_at": "2021-01-12T23:07:33-08:00",
"modified_at": "2021-01-12T23:07:33-08:00",
"trashed_at": null,
"purged_at": null,
"content_created_at": "2020-07-10T02:23:27-07:00",
"content_modified_at": "2020-07-10T02:23:27-07:00",
"created_by": {
"type": "user",
"id": "6893528044",
"name": "Jeet Prakash",
"login": "jeet.prakash+boxdev@jitterbit.com"
},
"modified_by": {
"type": "user",
"id": "6893528044",
"name": "Jeet Prakash",
"login": "jeet.prakash+boxdev@jitterbit.com"
},
"owned_by": {
"type": "user",
"id": "6893528044",
"name": "Jeet Prakash",
"login": "jeet.prakash+boxdev@jitterbit.com"
},
"shared_link": null,
"parent": {
"type": "folder",
"id": "0",
"sequence_id": null,
"etag": null,
"name": "All Files"
},
"item_status": "active"
},
{
"type": "file",
"id": "763568741183",
"file_version": {
"type": "file_version",
"id": "814404894383",
"sha1": "d0102ed19296717a42a51589e323fa26f7bbf7f0"
},
"sequence_id": "0",
"etag": "0",
"sha1": "d0102ed19296717a42a51589e323fa26f7bbf7f0",
"name": "demo-filenewc.csv",
"description": "",
"size": 96,
"path_collection": {
"total_count": 1,
"entries": [
{
"type": "folder",
"id": "0",
"sequence_id": null,
"etag": null,
"name": "All Files"
}
]
},
"created_at": "2021-01-12T23:07:37-08:00",
"modified_at": "2021-01-12T23:07:37-08:00",
"trashed_at": null,
"purged_at": null,
"content_created_at": "2020-06-05T04:18:57-07:00",
"content_modified_at": "2020-06-05T04:18:57-07:00",
"created_by": {
"type": "user",
"id": "6893528044",
"name": "Jeet Prakash",
"login": "jeet.prakash+boxdev@jitterbit.com"
},
"modified_by": {
"type": "user",
"id": "6893528044",
"name": "Jeet Prakash",
"login": "jeet.prakash+boxdev@jitterbit.com"
},
"owned_by": {
"type": "user",
"id": "6893528044",
"name": "Jeet Prakash",
"login": "jeet.prakash+boxdev@jitterbit.com"
},
"shared_link": null,
"parent": {
"type": "folder",
"id": "0",
"sequence_id": null,
"etag": null,
"name": "All Files"
},
"item_status": "active"
},
{
"type": "file",
"id": "763292893651",
"file_version": {
"type": "file_version",
"id": "814076670451",
"sha1": "2351d91b70087236bd440518a9a9717fe1983447"
},
"sequence_id": "0",
"etag": "0",
"sha1": "2351d91b70087236bd440518a9a9717fe1983447",
"name": "file.java",
"description": "",
"size": 33183,
"path_collection": {
"total_count": 3,
"entries": [
{
"type": "folder",
"id": "0",
"sequence_id": null,
"etag": null,
"name": "All Files"
},
{
"type": "folder",
"id": "63240439633",
"sequence_id": "0",
"etag": "0",
"name": "folder"
},
{
"type": "folder",
"id": "74659548772",
"sequence_id": "0",
"etag": "0",
"name": "from_workato2"
}
]
},
"created_at": "2021-01-12T04:27:10-08:00",
"modified_at": "2021-01-12T04:27:10-08:00",
"trashed_at": null,
"purged_at": null,
"content_created_at": "2019-01-03T04:50:37-08:00",
"content_modified_at": "2019-01-03T04:50:37-08:00",
"created_by": {
"type": "user",
"id": "6893528044",
"name": "Jeet Prakash",
"login": "jeet.prakash+boxdev@jitterbit.com"
},
"modified_by": {
"type": "user",
"id": "6893528044",
"name": "Jeet Prakash",
"login": "jeet.prakash+boxdev@jitterbit.com"
},
"owned_by": {
"type": "user",
"id": "6893528044",
"name": "Jeet Prakash",
"login": "jeet.prakash+boxdev@jitterbit.com"
},
"shared_link": null,
"parent": {
"type": "folder",
"id": "74659548772",
"sequence_id": "0",
"etag": "0",
"name": "from_workato2"
},
"item_status": "active"
},
{
"type": "file",
"id": "379803472641",
"file_version": {
"type": "file_version",
"id": "401480680641",
"sha1": "2351d91b70087236bd440518a9a9717fe1983447"
},
"sequence_id": "1",
"etag": "1",
"sha1": "2351d91b70087236bd440518a9a9717fe1983447",
"name": "file.java",
"description": "",
"size": 33183,
"path_collection": {
"total_count": 1,
"entries": [
{
"type": "folder",
"id": "0",
"sequence_id": null,
"etag": null,
"name": "All Files"
}
]
},
"created_at": "2019-01-07T22:48:58-08:00",
"modified_at": "2019-01-07T22:49:16-08:00",
"trashed_at": null,
"purged_at": null,
"content_created_at": "2019-01-03T04:50:37-08:00",
"content_modified_at": "2019-01-03T04:50:37-08:00",
"created_by": {
"type": "user",
"id": "6893528044",
"name": "Jeet Prakash",
"login": "jeet.prakash+boxdev@jitterbit.com"
},
"modified_by": {
"type": "user",
"id": "6893528044",
"name": "Jeet Prakash",
"login": "jeet.prakash+boxdev@jitterbit.com"
},
"owned_by": {
"type": "user",
"id": "6893528044",
"name": "Jeet Prakash",
"login": "jeet.prakash+boxdev@jitterbit.com"
},
"shared_link": null,
"parent": {
"type": "folder",
"id": "0",
"sequence_id": null,
"etag": null,
"name": "All Files"
},
"item_status": "active"
}
],
"limit": 30,
"offset": 0
}
-
正式なコメント
Hello All,
I was able to reproduce the behavior of a bug with sorting with ASC/DESC, as well as using the sort_by query param. I will proceed with filing a bug ticket with our engineering team.
I am not seeing the trimming you're seeing @Mulesoft. You will need to submit a support ticket from a paid account in order for our support team to further troubleshoot if needed.
Best,
Kourtney, Box Developer Advocate
コメントアクション -
Hi,
we are also facing the same issue with sorting.
If we make request to this endpoint
https://{{api.box.com}}/2.0/search?ancestor_folder_ids=118924929165&query=file&created_at_range=2021-01-22T10:53:43-08:00&sort=modified_at&direction=ASC
the response is (trimmed)
{
"total_count": 3,
"entries": [
{
"created_at": "2021-01-26T01:09:49-08:00",
"modified_at": "2021-01-26T01:09:49-08:00"
},
{
"created_at": "2021-01-26T01:10:05-08:00",
"modified_at": "2021-01-26T01:10:05-08:00"
},
{
"created_at": "2021-01-26T01:09:58-08:00",
"modified_at": "2021-01-26T01:09:58-08:00"
}
],
"limit": 30,
"offset": 0
}If we change query param direction=ASC to DESC the response is the same. This is not working as expected. Could you please look at it ? Really appreciate it. Thank you
投稿コメントは受け付けていません。
コメント
5件のコメント