Softaculous


Topic : [API BUG] Edit Server


Posted By: HOSTFLYTE on February 22, 2019, 5:23 am
Sending an API request to lock the server works just fine using the following POST headers (Variable values have been changed for the example).

PHP Code

 $post = array();
$post['server_name'] = "TEST SERVER";
$post['locked'] = 1;
$post['serid'] = 12;
$post['ip'] = "xx.xx.xx.xx";
$post['sgid'] = 3



However, It will not UNLOCK the server when running these headers.
PHP Code

 $post = array();
$post['server_name'] = "TEST SERVER";
$post['locked'] = 0;
$post['serid'] = 12;
$post['ip'] = "xx.xx.xx.xx";
$post['sgid'] = 3


We're literally just changing the "locked" value to 0, The API says that it has succeeded, but does not update the locked value.

Posted By: chirag on February 22, 2019, 10:47 am | Post: 1
Hi,

Sir there is not bug in this API call.

If you want to unlock the server, just do not pass the 'locked' key in array.
It will get unlocked.

Please check and let us know.

-----------------------
Virtualizor - VPS Control Panel
Follow us on Facebook

Posted By: HOSTFLYTE on February 22, 2019, 12:35 pm | Post: 2
Thanks for the quick reply, and you are correct, just omitting the locked var when unlocking works to unlock it.

HOWEVER, your documentation located at https://www.virtualizor.com/admin-api/edit-server implicitly states to pass a 1/0 in that var which is where the confusion started. 

Would it be possible to have API documentation updated?

Lastly,
You guys are doing an awesome job keep it up!

Posted By: chirag on February 22, 2019, 1:25 pm | Post: 3
Hi,

Sir we will update the documentation soon with the changes.

Thank you.

Let us know for further information.
We will be happy to help you.

-----------------------
Virtualizor - VPS Control Panel
Follow us on Facebook

Powered By AEF 1.0.8 © 2007-2008 Electron Inc.