public array DomainList( array $listdomains )
Returns all domains in a customer account.
Type | Parameter | Mandatory | Description |
---|---|---|---|
integer | $partnerid | yes | Partner ID. |
string | $signkey | yes | Sign key. |
string | $username | yes | User name. (max. 25 characters) |
string | $password | yes | Password. (max. 16 characters) |
integer | $startfrom | no | Start position. |
integer | $results | yes | Maximum number of results to return. (max. 100 per SOAP request) |
integer | $orderby | no |
Which property to order the results by:
|
string[] | $domain | no | Array of domain names in ACE format to filter for. (max. 100 per SOAP request) |
Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
array |
Array of domain records with the following properties:
|
<?php
try {
// Create a new client by providing the endpoint to the constructor.
$client = new SoapClient(
null,
[
'location' => 'https://api.sedo.com/api/v1/',
'soap_version' => SOAP_1_1,
'encoding' => 'UTF-8',
'uri' => 'urn:SedoInterface',
'style' => SOAP_RPC,
'use' => SOAP_ENCODED,
]
);
// Set the values for the array
$params = [
'partnerid' => 1234,
'signkey' => 'abcdefghijklmnopqrstuvwxyz0123456789',
'username' => 'johndoe',
'password' => 'secret',
'startfrom' => 0,
'results' => 100,
'orderby' => 0,
'domain' => ['example.com', 'example.net'],
];
// Call the SOAP method
$result = $client->DomainList($params);
// Display the result
echo "<table>";
echo "<tr>";
echo "<td>Domain</td>";
echo "<td>Category1</td>";
echo "<td>Category2</td>";
echo "<td>Category3</td>";
echo "<td>For sale</td>";
echo "<td>Price</td>";
echo "<td>Minprice</td>";
echo "<td>Fixedprice</td>";
echo "<td>Currency</td>";
echo "<td>Domainlanguage</td>";
echo "</tr>";
for($i = 0; $i<count($result); $i++)
{
echo "<tr>";
echo "<td>".$result[$i]['domain']."</td>";
echo "<td>".$result[$i]['category'][0]."</td>";
echo "<td>".$result[$i]['category'][1]."</td>";
echo "<td>".$result[$i]['category'][2]."</td>";
echo "<td>".$result[$i]['forsale']."</td>";
echo "<td>".$result[$i]['price']."</td>";
echo "<td>".$result[$i]['minprice']."</td>";
echo "<td>".$result[$i]['fixedprice']."</td>";
echo "<td>".$result[$i]['currency']."</td>";
echo "<td>".$result[$i]['domainlanguage']."</td>";
echo "</tr>";
}
echo "</table>";
} catch (SoapFault $e) {
echo 'Error: '.$e->getMessage();
}
<?php
/* URL to Sedo's API */
$baseUrl = 'https://api.sedo.com/api/v1/DomainList?';
/* API function parameters */
$params = [
'partnerid' => 1234,
'signkey' => 'abcdefghijklmnopqrstuvwxyz0123456789',
'username' => 'johndoe',
'password' => 'secret',
'output_method' => 'xml',
'startfrom' => 0,
'results' => 100,
'orderby' => 0,
'domain' => ['example.com', 'example.net'],
];
/* build request URL */
$request = $baseUrl . http_build_query($params);
/* fire API request */
$fp = @fopen($request, 'r');
/* read response line by line */
while (!@feof($fp)) {
echo fread($fp, 4096);
}
/* close the connection */
fclose($fp);
For a successful request, you will receive an XML document as response in this format:
<?xml version="1.0" encoding="UTF-8"?>
<SEDODOMAINLIST ver="1.0">
<item>
<domain type="xsd:string">example.com</domain>
<category>
<cat1 type="xsd:int">1</cat1>
<cat2 type="xsd:int">2</cat2>
<cat3 type="xsd:int">3</cat3>
</category>
<forsale type="xsd:int">1</forsale>
<price type="xsd:double">99.99</price>
<minprice type="xsd:double">0.00</minprice>
<fixedprice type="xsd:int">1</fixedprice>
<currency type="xsd:int">1</currency>
<domainlanguage type="xsd:string">en</domainlanguage>
</item>
<item>
<domain type="xsd:string">example.net</domain>
<category>
<cat1 type="xsd:int">1</cat1>
<cat2 type="xsd:int">2</cat2>
<cat3 type="xsd:int">3</cat3>
</category>
<forsale type="xsd:int">1</forsale>
<price type="xsd:double">99.99</price>
<minprice type="xsd:double">0.00</minprice>
<fixedprice type="xsd:int">1</fixedprice>
<currency type="xsd:int">1</currency>
<domainlanguage type="xsd:string">en</domainlanguage>
</item>
</SEDODOMAINLIST>
For an unsuccessful request, you will receive an XML document as response in this format:
<?xml version="1.0" encoding="UTF-8"?>
<SEDOFAULT ver="1.0">
<faultcode type="xsd:string">Exxx</faultcode>
<faultstring type="xsd:string">xxxxxx</faultstring>
</SEDOFAULT>
// Create package sedoapi:
// java org.apache.axis.wsdl.WSDL2Java -av -p sedoapi https://api.sedo.com/api/v1/?wsdl
import sedoapi.*;
import org.apache.axis.AxisFault;
public class SedoDomainList
{
public static void main(String[] args) throws Exception
{
sedoapi.SedoInterfaceServiceLocator locator = new sedoapi.SedoInterfaceServiceLocator();
sedoapi.SedoInterfacePortType port = locator.getSedoInterfacePort();
try {
String[] domains = {"example.com", "example.net"};
DomainListRequest request = new DomainListRequest();
request.setPartnerid(1234);
request.setSignkey("abcdefghijklmnopqrstuvwxyz0123456789");
request.setUsername("johndoe");
request.setPassword("secret");
request.setStartfrom(0);
request.setResults(10);
request.setOrderby(0);
request.setDomain(domains);
DomainListResponse[] response = port.domainList(request);
for (int i = 0; i < response.length; i++) {
int[] categories = response[i].getCategory();
System.out.println("Domain: " + response[i].getDomain());
for (int j = 0; j < categories.length; j++) {
System.out.println("Category: " + categories[j]);
}
System.out.println("Forsale: " + response[i].getForsale());
System.out.println("Price: " + response[i].getPrice());
System.out.println("Minprice: " + response[i].getMinprice());
System.out.println("Fixedprice: " + response[i].getFixedprice());
System.out.println("Currency: " + response[i].getCurrency());
System.out.println("Domainlanguage: " + response[i].getDomainlanguage());
System.out.println("--------");
}
} catch (AxisFault fault) {
System.err.println("Faultcode : " + fault.getFaultCode());
System.err.println("Faultstring : " + fault.getFaultString());
}
}
}