library

If you want to get PNG, SVG, GIF, and JPG files from default or custom libraries, use the file/library command.

Copied!
svc=file/library&params={"type":<text>,
                         "flags":<uint>}

Parameters

Parameter

Description

type

Library name. The default values are unit, group, poi.

flags

Specify one of the values:
0
- list files only from the default library (only default
type values are valid);
1 - list files from all available hierarchy libraries recur-
sively (your account, parent, parent's parent, etc.)

Creating and finding a custom library

To create a custom library, follow these steps:

1. Create the directory library in the public file storage of the account: <account_id>/1/library
2. Place a custom library in the library folder. For example, if your custom library is called cust_lib, the path will be <account_id>/1/library/cust_lib

To find the custom library and list its content, specify the library name as a type value. For example, type:‘cust_lib’

Response

If the request is completed successfully, a list of files is returned.

Copied!
{
    "<account_id>": [        /* account ID, 0 - default library */
                      {
                          "n":<text>,      /* file name */
                          "s":<uint>,      /* file size (bytes) */
                          "ct":<uint>,     /* file creation time, UNIX-time */
                          "mt":<uint>      /* file last modification time, UNIX-time */
                      },
                      ...
    ],
    ...                      /* other account IDs (if any) */
}

If the request is not completed, an error code is returned.

Error codes

Code

Description

1User not authorized.
4Invalid input parameters.
5Failed to retrieve the list of files from the library and accounts.  
7Failed to retrieve the current account or item with the standard library.
Download PDF file
Download Word document

See also