API -> List all subdomains

smilie

Verified User
Joined
Jul 2, 2010
Messages
5
Hi,

I found this answer on the forum from support:

"Added:
http://www.directadmin.com/features.php?id=330

It's for Users.. Admins/Resellers can just use the admin|user feature if they need the list.

John"

However I can not get list of all subdomains as admin :(
All users are under the admin account, but I still get this error:

[error] => 1 [text] => Unable to show subdomains [details] => You do not own that domain

This is after executing command:
$domainArray['domain'] = $domain;
$this->query('/CMD_API_SUBDOMAINS',$domainArray);
while logged in as main admin user.

http://1.2.3.4:2222/CMD_SUBDOMAINS
Gives me:
The request you've made cannot be executed because it does not exist in your authority level

----

So, question is:
How can I, logged in as Admin get list of all Subdomains based on a main domain?

Thanx!
Aleks
 
Oke, I got few steps further :)
What I really needed is command:
CMD_API_ADDITIONAL_DOMAINS

However - logged in as Admin this action returns empty array. I need to be logged in as user him self to be able to see this info.

How can I do same as admin (admin is the owner of that user btw).

Thanx
Aleks
 
Hello,

If you're getting "You do not own that domain", and you have not made any typos in entering the name of the domain.. and it exists under a User account, created by "admin".. then it would imply that you're probably still logged in as "admin".. or perhaps some other User, and not the User who actually owns the domain.

My guess would be a typo somewhere in your code.

To login as the User, as mentioned, you'd use the login-as feature, so in your code, the username value would be something like:
Code:
$username = "admin|[b]username[/b]";
where username is the name who actually owns the domain.

Running DA in debug mode may help you figure out what exactly is being passed/requested:
http://help.directadmin.com/item.php?id=293

John
 
Back
Top