Skip to content
Yannick Croissant edited this page Aug 16, 2013 · 9 revisions
  • auth: Authenticate the user and get a token for the current session.
  • info: Return informations about the available APIs.

api.auth

Authenticate the user and get a token for the current session.

This method is automatically called internally to get a sid for all api requests.

Parameters

Parameter Mandatory Default value Description
account Y Login account name
passwd Y Login account password

Example

var Synology = require('synology');

var syno = new Synology();

syno.api.auth({
  account: 'mylogin',
  passwd: 'mypassword'
}, function(err, data) {
  if (err) throw err;
  console.log(data);
});

Results

{
    "data": {
        "sid": "5uBDokPa1jb9F"
    },
    "success": true
}

api.info

Return informations about the available APIs.

Parameters

Parameter Mandatory Default value Description
query ALL API names concatenated by , or use ALL to get all supported APIs.

Example

var Synology = require('synology');

var syno = new Synology();

syno.api.info({
  query: 'SYNO.API.Info,SYNO.API.Auth'
}, function(err, data) {
  if (err) throw err;
  console.log(data);
});

Results

{
    "data": {
        "SYNO.API.Auth": {
            "maxVersion": 3,
            "minVersion": 1,
            "path": "auth.cgi"
        },
        "SYNO.API.Info": {
            "maxVersion": 1,
            "minVersion": 1,
            "path": "query.cgi"
        }
    },
    "success": true
}

Clone this wiki locally