read
To read a text file, use the file/read method.
svc=file/read¶ms={
"itemId": <long>,
"storageType": <uint>,
"path": <text>,
"contentType": <uint>
}
Parameters
| Parameter | Description |
|---|---|
| itemId | Item ID. |
| storageType | Storage type: 1 — public (all users can see and download files), 2 — 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.
{
"content": <content>
}
If the request hasn’t been completed, an error code is returned.
Error codes
| Code | Description |
|---|---|
| 1 | User not authorized. |
| 3 | File not found. |
| 4 | Invalid input parameters. |
| 7 | The item specified in the itemId parameter isn’t found, the storageType value is invalid, or you have no View and download files access right to the item (required for the protected storage). |