Difference between revisions of "API:listaccts"

From TheHostingTool Wiki
Jump to navigationJump to search
(Created page with '==Usage== ==Parameters== * None ==Output== <pre> <listaccts> <acct> <id>1</id> <userid>stuff</userid> <email>email@gmail.com</email> …')
 
Line 1: Line 1:
 
==Usage==
 
==Usage==
 +
This API function will list all the accounts in the THT database. The function name is ''listaccts'' and does not have any parameters. The URL would look something like this:
 +
<pre>http://mydomain.tld/THT_DIR/xml-api/listaccts/auth_hash</pre>
 +
 
==Parameters==
 
==Parameters==
 
* None
 
* None

Revision as of 02:11, 15 February 2010

Usage

This API function will list all the accounts in the THT database. The function name is listaccts and does not have any parameters. The URL would look something like this:

http://mydomain.tld/THT_DIR/xml-api/listaccts/auth_hash

Parameters

  • None

Output

<listaccts>
        <acct>
            <id>1</id>
            <userid>stuff</userid>
            <email>email@gmail.com</email>
            <signup>Date</signup>
            <ip>192.168.1.2</ip>
            <domain>somewhereovertherainbow.com</domain>
            <pid>1</pid>
            <status>Suspended</status>
            <additional></additional>
        </acct>
</listaccts>

Example

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://mydomain.tld/THT_DIR/xml-api/listaccts/auth_hash');
$val = curl_exec($ch);
curl_close($ch);
$xml = new SimpleXMLElement($val);
unset($val);
echo $xml->acct[0]->domain[0];
?>

Example Output

somewhereovertherainbow.com