My reseller account cannot access the api

desbest

New member
Joined
Aug 17, 2007
Messages
1
I want to code myself a billing script for my DirectAdmin webhost and I've used the api to find that I don't have the correct permissions to do so.

I am running a reseller account, and find it annoying that I can't access the api.

I don't think that running Clientexec on my account would work, because if my account can't access the api. How can clientexec?

I would really appreciate your response?
Thanks

Code:
<?php

include 'httpsocket.php';

$sock = new HTTPSocket;

$sock->connect('yoursite.com',2222);
$sock->set_login('admin','password');

$sock->query('/CMD_API_SHOW_ALL_USERS');
$result = $sock->fetch_parsed_body();

print_r($result);

?>
Above is the code which I couldn't execute.
 
Last edited:
Hello,

Resellers don't have access to the SHOW_ALL_USERS command, that's an Admin command.

The trick to finding the command you want, is to go to the versions system:
http://www.directadmin.com/versions.php
Do a search for:
CMD_API
add a space, and type in something specific to what you're looking for:
CMD_API show all users

which would give you this
http://www.directadmin.com/search_versions.php?query=CMD_API+show+all+users

A few commands that would work:
http://www.directadmin.com/features.php?id=495

There are also the intial commands in the www.directadmin.com/api.html which won't be in the versions system.. because they've been there since the beginning:

Which has the exact command to get a list of users here:
http://www.directadmin.com/api.html#showusers
CMD_API_SHOW_USERS

The majority of the commands in the API are run using the same code as the interface commands... the only different is that you put a CMD_API_name where CMD_name used to be, then try searching the versions system or the api.html for that command.

John
 
Back
Top