Execute a command via web api
var Daystodiewebapi = require('machinepack-7daystodiewebapi');
// Execute a command via web api
Daystodiewebapi.executeCommand({
ip: '192.168.0.1',
port: '8082',
command: 'kick',
authName: 'csmm',
authToken: 'EOGHZANOIZEAHZFUR93573298539242F3NG',
}).exec({
// An unexpected error occurred.
error: function (err) {
},
// Server refused the request (usually means server offline)
connectionRefused: function () {
},
// Not authorized to do this request
unauthorized: function () {
},
// Unknown command entered
unknownCommand: function () {
},
// OK.
success: function () {
},
});
IP of the server to send a request to
'192.168.0.1'
Port of the server to send a request.
'8082'
Command to execute on the server
'kick'
Authorization name to send with the request
'csmm'
Authorization token to send with the request
'EOGHZANOIZEAHZFUR93573298539242F3NG'
An unexpected error occurred.
Server refused the request (usually means server offline)
Not authorized to do this request
Unknown command entered
OK.