list
To see the storage folder structure, use the file/list method.
svc=file/list¶ms={"itemId":<long>,
"storageType":<uint>,
"path":<text>,
"mask":<text>,
"recursive":<bool>,
"fullPath":<bool>}
Parameters
| Parameter | Description |
|---|---|
| itemId | Item ID. |
| storageType | Storage type: 1 - public (all users can see and download files), 2 - protected (only users with the View and download files access right to the item can see and download files). |
| path | Relative path from the root folder to the folder. |
| mask | File name mask. It can contain the asterisk (*) which replaces 0 or more characters, and the question mark (?) which replaces 1 character. If you specify several masks, separate them by commas. |
| recursive | Use this flag to specify whether you want the content to be displayed recursively with subdirectories. |
| fullPath | Use this flag to specify whether you want to see the full path of the items. |
Only the item creator can place and delete files.
Response
If the request is completed successfully, the storage structure is returned. The signature n/c means that the hierarchy item is a folder, the signature n/s means this is a file.
[
{
"n": <text>, /* folder name; if "fullPath":true, the path from the root folder */
"c": [...] /* folder content, it can include files and/or folders; returned if "recursive":true */
},
{
"n": <text>, /* file name; if "fullPath":true, the path from the root folder */
"s": <uint>, /* file size (bytes) */
"ct": <uint>, /* file creation time, UNIX-time */
"mt": <uint> /* file last modification time, UNIX-time */
},
...
]
If the request hasn’t been completed, an error code is returned.
Error codes
| Code | Description |
|---|---|
| 1 | User not authorized. |
| 4 | Invalid input parameters. |
| 5 | Failed to get the list of files at the specified path. |
| 7 | The item specified in the itemId parameter isn’t found, or you have no View and download files access right to it (for the protected storage). |