API results limit

jruiz

Verified User
Joined
Jul 2, 2013
Messages
6
Hi,

I'm trying to use CMD_API_DOMAIN_OWNERS to determine which user owns a domain. The problem is that the results are limited to 1000, and in a certain server we have much more than 1000 accounts...

is there any way to avoid or increase this limit?

thanks!!
 
Hello,

There shouldn't be any limit...
I've tested it on our build system.

I used this script to generated 1200 entries in the domainowners file:
Code:
#!/bin/sh

TRIES=0
while [ ${TRIES} -lt 1200 ];
do
        echo "domain${TRIES}.com: user${TRIES}";
        ((TRIES++))
done;
with:
Code:
cd /etc/virtual/
./big_do.sh >> domainowners
then ran the API...

I dumped the output into our test script:
http://help.directadmin.com/item.php?id=204

and it did seem to dump out the ~1230 entries (there were a few others before I added 1200 more)...

Note, our testing script used to use a text input.
We found that this did chop off results (not sure it if was a browser or php).. but changing it to a textarea for testing sorted it out.
The API output was correct though.

The only thing that I can think of which would chop off the output would be pagination:
http://www.directadmin.com/features.php?id=985

but if you're not passing any of it, you should be getting the entire chunk of data.

Also ensure your script isn't hitting a memory limit.

John
 
Hi, Thank you very much for your help.

Yes, after reading your answer I looked a bit more deeply and I found that since php 5.3.9 , "max_input_vars" limits the function parse_str (used to parse the API response), and the default value for max_input_vars is 1000... I increased the value and it works perfectly now.

Thanks again for your help and sorry "for the noise" :-P
Regards!
 
Back
Top