Skip to content

synology fileStation

Yannick Croissant edited this page Aug 16, 2013 · 2 revisions

fileStation.backgroundTask

?????

fileStation.checkPermission

?????

fileStation.compress

?????

fileStation.copyMove

?????

fileStation.createFolder

?????

fileStation.delete

?????

fileStation.dirSize

?????

fileStation.download

?????

fileStation.extract

?????

fileStation.favorite

?????

fileStation.info

?????

fileStation.list

GET /webapi/FileStation/file_share.cgi

List a folder

Parameters

Parameter Mandatory Default value Description
api Y Method ID: SYNO.FileStation.List
version Y Version of the api to use. Possible values: 1.
method Y Method to use. Possibles values: list_share, list
node (?) Possible values: fm_root
action list Action to perform. Possible values: list.
additional Additional informations to retrieve, concatenated by ,. Possibles values: real_path, size, owner, time, perm, type and mount_point_type.
filetype all Filetype filter. Possible values: dir, file and all
pattern Pattern for file filtering (wildcards allowed)
folder_path /home Absolute path of the folder to list.
limit 1000 Maximum number of files to return.
offset 0 Offset where to start the listing.
sort_by name Field used to order the files. Possible values: name, size, type, user, mtime, crtime, atime, privilege_str and group.
sort_direction ASC Set to ASC for an ascending order or to DESC for a descending one

NOTE: When listing the root directory, method is set to list_share and node is set to fm_root. In other cases method is set to list and node is not set.

Example

var Synology = require('synology');

var syno = new Synology();

syno.query({
  path: '/webapi/FileStation/file_share.cgi',
  params: {
    api: 'SYNO.FileStation.List',
    version: 1,
    method: 'list',
    folder_path: '/web',
    additional: 'real_path,size',
    pattern: '*module*'
  }
}, function(err, data) {
  if (err) throw err;
  console.log(data);
});

Results

{
    "data": {
        "files": [
            {
                "additional": {
                    "real_path": "/volume1/web/node_modules",
                    "size": "4096"
                },
                "isdir": true,
                "name": "node_modules",
                "path": "/web/node_modules"
            },
            {
                "additional": {
                    "real_path": "/volume1/web/module.js",
                    "size": "14251"
                },
                "isdir": false,
                "name": "module.js",
                "path": "/web/module.js"
            }
        ],
        "offset": 0,
        "total": 2
    },
    "success": true
}

fileStation.MD5

?????

fileStation.rename

?????

fileStation.search

?????

fileStation.share

GET /webapi/FileStation/file_sharing.cgi

Create or delete a shareable link for a file or a directory

Parameters

Parameter Mandatory Default value Description
api Y Method ID: SYNO.FileStation.Sharing
version Y Version of the api to use. Possible values: 1.
method Y Method to use. Possibles values: create, delete
path Y File or directory to share.

Example

var Synology = require('synology');

var syno = new Synology();

syno.query({
  path: '/webapi/FileStation/file_share.cgi',
  params: {
    api: 'SYNO.FileStation.Sharing',
    version: 1,
    method: 'create',
    path: '/home/foo/bar.txt'
  }
}, function(err, data) {
  if (err) throw err;
  console.log(data);
});

Results

{
    "data": {
        "links": [{
            "error": 0,
            "id": "hLjd88BO",
            "path": "/home/foo/bar.txt",
            "qrcode": "iVBORw0KGgoAA..."
        }]
    },
    "success": true
}

fileStation.thumb

?????

fileStation.upload

POST /webapi/FileStation/api_upload.cgi

Upload a file

Parameters

Parameter Mandatory Default value Description
api Y Method ID: SYNO.FileStation.Upload
version Y Version of the api to use. Possible values: 1.
method Y Method to use. Possibles values: upload
file Y File to upload (Stream).
overwrite Y Overwrite the file if it already exists.
create_parents Y Automatically create the parents directories if needed.
dest_folder_path Y Destination folder

fileStation.virtualFolder