marcovoort
Verified User
- Joined
- May 21, 2014
- Messages
- 5
Hi,
I was searching for a method to modify the package of a user, using the DA API. Unfortunately, the API docs don't seem to reference to anything like this. ( http://www.directadmin.com/api.html#modify )
After some research I found the following thread on this forum: http://forum.directadmin.com/showthread.php?t=43284 . I've implemented this as follows:
The $obj_socket is just an instance of the HTTPSocket class provided on the API docs page. However, executing this with proper input (existing user & package), I get the following output:
i.e., no result at all. In the DA control panel I see the package does not change either, so this code is incorrect. So; I tried changing the value of 'action' to 'modify', 'user' to 'username' and CMD_API_MODIFY_USER to CMD_MODIFY_USER, and some combinations of those, but they did not seem to work either. As I'm quite stuck now, I'd like to ask what I'm doing wrong here?
Thanks in advance!
I was searching for a method to modify the package of a user, using the DA API. Unfortunately, the API docs don't seem to reference to anything like this. ( http://www.directadmin.com/api.html#modify )
After some research I found the following thread on this forum: http://forum.directadmin.com/showthread.php?t=43284 . I've implemented this as follows:
PHP:
$this->obj_socket->query('/CMD_API_MODIFY_USER',
array(
'action' => 'package',
'user' => $s_username,
'package' => $s_package
));
$a_result = $this->obj_socket->fetch_parsed_body();
The $obj_socket is just an instance of the HTTPSocket class provided on the API docs page. However, executing this with proper input (existing user & package), I get the following output:
PHP:
var_dump($a_result);
// -> array(0) { }
i.e., no result at all. In the DA control panel I see the package does not change either, so this code is incorrect. So; I tried changing the value of 'action' to 'modify', 'user' to 'username' and CMD_API_MODIFY_USER to CMD_MODIFY_USER, and some combinations of those, but they did not seem to work either. As I'm quite stuck now, I'd like to ask what I'm doing wrong here?
Thanks in advance!