library
If you want to get PNG, SVG, GIF, and JPG files from default or custom libraries, use the file/library command.
svc=file/library¶ms={"type":<text>,
"flags":<uint>}
Parameters
Parameter | Description |
---|---|
type | Library name. The default values are unit, group, poi. |
flags | Specify one of the values: |
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.
{
"<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 |
---|---|
1 | User not authorized. |
4 | Invalid input parameters. |
5 | Failed to retrieve the list of files from the library and accounts. |
7 | Failed to retrieve the current account or item with the standard library. |