read

To read a text file, use the file/read command.

Copied!
svc=file/read&params={
    "itemId": <long>,
    "storageType": <uint>,
    "path": <text>,
    "contentType": <uint>
}

Parameters

Parameter

Description

itemId

Item ID.

storageType

Storage type:
 public (all users can see and download files),
 protected (only users with access rights can see and download files).

path

Relative path from the root folder to the file.

contentType

Content type. The content can be returned as:
0 — text,
1 — hex string,
2 — base64 string.

Response

If the request has been completed successfully, the file content is returned.

Copied!
{
    "content": <content>
}

If the request hasn’t been completed, an error code is returned.

Error codes

CodeDescription
1User not authorized.
3File not found.
4Invalid input parameters.
7Insufficient rights to the item specified in the itemId parameter.
Download PDF file
Download Word document

See also