Hello again :)
Im trying to write a plugin, that need to stop the server, then do something and after that start the server. im already found that i can do over api: /API/ADSModule/Servers/SERVERIDHERE/Core/Login SERVERIDHERE i replace with InstanceID from my server.
const todo = { username: "admin", password: "123", token: "", rememberMe: "false" };
fetch('/API/ADSModule/Servers/4fb97e39-b5fe-44d7-8662-938abbd86f4b/Core/Login', { method: 'POST', body: JSON.stringify(todo), headers: { 'Content-type': 'application/json', 'accept': 'application/json', } }) .then(response => response.json()) .then(json => { console.log(json); });
but i cant login i only get error. VM26534:1 Uncaught (in promise) SyntaxError: Unexpected end of JSON input
at
I try more methods for it. All work if i use /API/Core/Login but if i try to login in specific Instance not working.
So is it the right way for the plugin to login etc ? or are better ways avaible?
something like: AMPDataLoaded: function ()... that i can get there all information to stop and start the server where i am(at the server instance) ?