
20th June 2012, 10:06
|
|
Senior Member
|
|
Join Date: Oct 2006
Posts: 131
Thanks: 19
Thanked 4 Times in 4 Posts
|
|
Getting all Clients via API
Hello,
can someone please tell me if there is a way to retrieve all clients at once via the API?
Thank you!
regards, Tom
|

20th June 2012, 21:05
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,894
Thanks: 693
Thanked 4,189 Times in 3,206 Posts
|
|
This should work:
$clients = $client->client_get($session_id, array('parent_client_id' => '0'));
|
|
The Following User Says Thank You to till For This Useful Post:
|
teves (21st June 2012)
|

21st June 2012, 10:12
|
|
Senior Member
|
|
Join Date: Oct 2006
Posts: 131
Thanks: 19
Thanked 4 Times in 4 Posts
|
|
hi Till,
this works perfectly, thank you very much!
I looked it up in the API documentation contained in the ISPConfig release package, but could not find a hint. Did I miss it or is it not in there? Is there another place where I can find out the details of the API without bugging you all the time? ;-)
Regards, Tom
|

21st June 2012, 10:24
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,894
Thanks: 693
Thanked 4,189 Times in 3,206 Posts
|
|
Hi,
all ..._get() functions in the API support a array as ID parameter and in the array you can use any field of the corresponding database table. The values can contain % as wildcard.
so this query:
$clients = $client->client_get($session_id, array('contact_name' => '%John%'));
woud return all clients were "John" is in the contact name field.
|
|
The Following User Says Thank You to till For This Useful Post:
|
teves (21st June 2012)
|

21st June 2012, 12:21
|
|
Senior Member
|
|
Join Date: Oct 2006
Posts: 131
Thanks: 19
Thanked 4 Times in 4 Posts
|
|
Hi,
thanks! This is a very helpful piece of information!
Most recently I have programmed for Plesk, and I have to point out that their RPC API ist a large pile of crap (and their support is even worse). I have not seen a lot of the ISPConfig API yet, but I like it much better already.... ;-)
And, btw, I have seen a lot of the ISPConfig community support, and I cannot stress enough how great it is!
Regards, Tom
|
|
The Following User Says Thank You to teves For This Useful Post:
|
falko (21st June 2012)
|

26th June 2012, 12:18
|
|
Senior Member
|
|
Join Date: Oct 2006
Posts: 131
Thanks: 19
Thanked 4 Times in 4 Posts
|
|
I am sorry but I have another question...
I would like to create a list of domains of a certain client (via API), but the domain array I get via SOAP does not seem to contain information on the owner client.
When I fetch all domains and try to find out the clients via the client_get_id function, I only get the admin ID (which is the user who created the domains).
The api function domains_get_all_by_user gives a list of the domains created by a certain user, I assume? But this does not help me here...
But in Ispconfig, Tab "Sites", there is a list of the domains, with the owner clients in front. So there must be a way...
Can someone give me a hint please?
Regards, Tom
|

26th June 2012, 12:55
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,894
Thanks: 693
Thanked 4,189 Times in 3,206 Posts
|
|
Quote:
|
I would like to create a list of domains of a certain client (via API), but the domain array I get via SOAP does not seem to contain information on the owner client.
|
The records conatin the user and group information. Every client has its own group, so you can select them by filtering on the group ID which is associated with the client.
|
|
The Following User Says Thank You to till For This Useful Post:
|
teves (26th June 2012)
|

3rd July 2012, 09:53
|
|
Senior Member
|
|
Join Date: Oct 2006
Posts: 131
Thanks: 19
Thanked 4 Times in 4 Posts
|
|
When I try to fetch the subdomains of a domain with the following SOAP request:
sites_web_subdomain_get($session_id, array("parent_domain_id" => $id) )
I do not only get the subdomains, but also the aliasdomains with the same parent_domain_id. Is this bug or feature?
I tested it with the request
sites_web_aliasdomain_get($session_id, array("parent_domain_id" => $id))
too, the behaviour is exactly the same....
So the output of two different SOAP commands is the same, this can't be intentional, can it?
|

3rd July 2012, 10:16
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,894
Thanks: 693
Thanked 4,189 Times in 3,206 Posts
|
|
Both commands work on the same table and with array("parent_domain_id" => $id) you override all other selections. If you want to use the array paremeter and get subdomains only, then the query is:
sites_web_subdomain_get($session_id, array("parent_domain_id" => $id,"type" => 'subdomain') )
|
|
The Following User Says Thank You to till For This Useful Post:
|
teves (3rd July 2012)
|

3rd July 2012, 14:06
|
|
Senior Member
|
|
Join Date: Oct 2006
Posts: 131
Thanks: 19
Thanked 4 Times in 4 Posts
|
|
Quote:
Originally Posted by till
The records conatin the user and group information. Every client has its own group, so you can select them by filtering on the group ID which is associated with the client.
|
It should be mentioned that it is necessary to use the undocumented (!) SOAP call
client_get_groupid($session_id, $client_id)
to obtain the group_id of a client. Strangely, the group_id is not included in the answers to the client_get() and client_get_by_username() functions.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 13:44.
|
|
Recent comments
4 hours 32 min ago
14 hours 19 sec ago
14 hours 49 min ago
18 hours 23 min ago
22 hours 47 min ago
23 hours 9 min ago
1 day 1 hour ago
1 day 11 hours ago
1 day 16 hours ago
1 day 17 hours ago