-
Notifications
You must be signed in to change notification settings - Fork 13
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.
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.
| Parameter | Mandatory | Default value | Description |
|---|---|---|---|
account |
Y | Login account name | |
passwd |
Y | Login account password |
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);
});{
"data": {
"sid": "5uBDokPa1jb9F"
},
"success": true
}Return informations about the available APIs.
| Parameter | Mandatory | Default value | Description |
|---|---|---|---|
query |
ALL |
API names concatenated by , or use ALL to get all supported APIs. |
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);
});{
"data": {
"SYNO.API.Auth": {
"maxVersion": 3,
"minVersion": 1,
"path": "auth.cgi"
},
"SYNO.API.Info": {
"maxVersion": 1,
"minVersion": 1,
"path": "query.cgi"
}
},
"success": true
}