Box.com Search API for extracting all files in a specific folder

I am looking for a way to get all the files of a specific folder.

But I can not find enough information in the official documentation

I am thinking of something like this: (I also assume for a custom header using access_token)

https://api.box.com/2.0/search?query=*

This method does not work, and I think the request does not accept the regex ...

Any idea?


PS: a real utility will help to understand this question:

my folder:

folderOne:
 |
 |_file1.jpg
 |
 |_file2.doc
 |
 |_folder1
 | |_file3.jpg
 | |_folder2
 |
 |_file4.pdf

with a search query, I expect to receive only file1.jpg, file2.docand file4.pdf.

+4
source share
1 answer

, file.

curl https://api.box.com/2.0/folders/FOLDER_ID/items \
-H "Authorization: Bearer ACCESS_TOKEN"

, , type - file.

{
  "total_count": 4,
  "entries": [
     {
        "type": "folder",
        "id": "192429928",
        "name": "folder1"
     },
     {
        "type": "file",
        "id": "818853862",
        "name": "file1.jpg"
     },
     {
        "type": "file",
        "id": "818853843",
        "name": "file2.doc"
     },
     {
        "type": "file",
        "id": "818853832",
        "name": "file4.pdf"
     }
  ]
}

. , . , "" 13 , 25 :

/folders/FOLDER_ID/items?limit=25&offset=13
/folders/FOLDER_ID/items?limit=25&offset=38
/folders/FOLDER_ID/items?limit=25&offset=63
/folders/FOLDER_ID/items?limit=25&offset=...
+5

Source: https://habr.com/ru/post/1543874/


All Articles