Target URL | /api.php/files/browse/ |
Required scope | list |
HTTP Method | GET/POST |
Output format | JSON |
Request Parameters Reference
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
path | string | Yes | Examples: /ROOT - shows a list with items like "My Files", "Shared with me", "Starred" (the list can change in the future) / - same as above /ROOT/HOME - items located inside the users home folder (My Files) /STARRED - starred items /PHOTOS - latest photos /MUSIC - latest audio files /SHARES - items shared by the user /LINKS - items shared through web links /ROOT/SHARED - users with shares or folders shared anonymously by other users /ROOT/123 - lists folders shared by user with ID 123. /ROOT/123/456 - list items inside the share with ID 456 owned by user with ID 123. |
|
itemType | string | Yes | Choose type of items to list. Possible values: any - lists both files and folders files - lists only files folders - lists only folders |
|
recursive | boolean | false | No | List items from all the subfolders. |
details | array | No | Allows you to choose what information should be retrieved for each file. | |
details[uuid] | array key | No | unique id which can be used for referencing the file or folder | |
details[mdate] | array key | No | modified date | |
details[mdateHuman] | array key | No | modified date in a friendly format | |
details[cdate] | array key | No | creation date | |
details[hasWebLink] | array key | No | if file has weblink attached to it or not | |
details[weblink] | array key | No | retrieve weblink URL | |
details[weblink-full] | array key | No | retrieve full weblink details | |
details[description] | array key | No | file type description | |
details[ext] | array key | No | file extension | |
details[type] | array key | No | type of file (defined inside system/data/filetypes.php) | |
details[icon] | array key | No | filename of the FileRun icon associated with this type of files | |
details[hasThumb] | array key | No | shows if FileRun can generate a thumbnail for the file | |
details[fileSize] | array key | No | includes the file size in bytes | |
details[nicerFileSize] | array key | No | includes formatted file size | |
details[commentsCount] | array key | No | includes number of attached user comments | |
details[label] | array key | No | includes files labels | |
details[isLocked] | array key | No | shows if file is locked | |
details[version] | array key | No | includes current file version | |
details[isShared] | array key | No | shows if folder is currently shared |
Example
Listing only files from the users home folder, retrieving information about their attached weblinks and also including a formatted filesize:
path=/ROOT/HOME
itemType=files
details[[]]=nicerFileSize
details[[]]=weblink
path=/ROOT/HOME - the users home folder
itemType=files - listing only files
details[]=nicerFileSize - including a formatted filesize
details[]=weblink - including the URL, if a weblink is attached
Expected output:
1{
2 "success":true,
3 "error":false,
4 "data":{
5 "meta":{
6 "path":"\/ROOT\/HOME",
7 "parentPath":"\/ROOT",
8 "folderName":"Home Folder",
9 "perms":{
10 "upload":true,
11 "download":"1",
12 "alter":true
13 }
14 },
15 "files":[
16 {
17 "filename":"FileRun_Admin_Guide.pdf",
18 "weblink":"http:\/\/demo.filerun.com\/wl\/?id=89M",
19 "is_dir":false,
20 "nicerFileSize":"123 KB"
21 },
22 {
23 "filename":"FileRun_License_Agreement.pdf",
24 "is_dir":false,
25 "nicerFileSize":"116 KB"
26 },
27 {
28 "filename":"FileRun_User_Guide.pdf",
29 "is_dir":false,
30 "nicerFileSize":"195 KB"
31 },
32 {
33 "filename":"Welcome.jpg",
34 "is_dir":false,
35 "nicerFileSize":"17 KB"
36 }
37 ]
38 }
39}