Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 20th June 2012, 11:06
teves teves is offline
Senior Member
 
Join Date: Oct 2006
Posts: 150
Thanks: 27
Thanked 15 Times in 10 Posts
Default 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
Reply With Quote
Sponsored Links
  #2  
Old 20th June 2012, 22:05
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,651 Times in 4,461 Posts
Default

This should work:


$clients = $client->client_get($session_id, array('parent_client_id' => '0'));
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
teves (21st June 2012)
  #3  
Old 21st June 2012, 11:12
teves teves is offline
Senior Member
 
Join Date: Oct 2006
Posts: 150
Thanks: 27
Thanked 15 Times in 10 Posts
Default

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
Reply With Quote
  #4  
Old 21st June 2012, 11:24
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,651 Times in 4,461 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
teves (21st June 2012)
  #5  
Old 21st June 2012, 13:21
teves teves is offline
Senior Member
 
Join Date: Oct 2006
Posts: 150
Thanks: 27
Thanked 15 Times in 10 Posts
Default

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
Reply With Quote
The Following User Says Thank You to teves For This Useful Post:
falko (21st June 2012)
  #6  
Old 26th June 2012, 13:18
teves teves is offline
Senior Member
 
Join Date: Oct 2006
Posts: 150
Thanks: 27
Thanked 15 Times in 10 Posts
Default

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
Reply With Quote
Reply

Bookmarks

Tags
api, get all clients

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
added client through remote api can't add database paddox Developers' Forum 2 27th February 2012 13:59
ISPConfig3 + API + BoxBilling class450dude Installation/Configuration 3 22nd August 2011 23:32
A few questions on client's modules and limits dimas Installation/Configuration 10 10th January 2011 21:22
Can't Ping over VPN RoMiONeT Server Operation 2 4th July 2010 01:19
Accessing clients web without domain wicht General 3 10th August 2007 12:28


All times are GMT +2. The time now is 03:51.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.