public array DomainParkingFinalStatistics( array $finalstatisticsrequest )
Returns parking statistics for a Sedo customer.
There are 5 different types of statistics.
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) |
string | $domain | no | Domain name in ACE format. |
integer | $period | yes |
Reporting period:
|
string | $date | no |
Date in the format YYYY-MM-DD . Mandatory
for $period values 0 and
2 .
|
integer | $startfrom | yes |
Start position. Mandatory for $period
values 0 and 2 , otherwise
0 .
|
integer | $results | yes |
Number of results from the start position. Mandatory
for
Limitations:
If the function is called using SOAP, results
are limited to a maximum of 500.
GET requests are limited to a maximum of
10,000 results.
|
Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
array |
The return value contains the following elements:
|
<?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',
'domain' => 'example.com',
'period' => 0,
'date' => '2017-01-01',
'startfrom' => 0,
'results' => 0,
];
// Call the SOAP method
$result = $client->DomainParkingFinalStatistics($params);
// Display the result
echo "<table>";
echo "<tr>";
echo "<td>Domain</td>";
echo "<td>Date</td>";
echo "<td>Visitors</td>";
echo "<td>Clicks</td>";
echo "<td>Earnings</td>";
echo "<td>Payout Status</td>";
echo "</tr>";
for ($i = 0; $i < count($result); $i++) {
echo "<tr>";
echo "<td> " . $result[$i]['domain'] . "</td>";
echo "<td>" . $result[$i]['date'] . "</td>";
echo "<td>" . $result[$i]['visitors'] . "</td>";
echo "<td>" . $result[$i]['clicks'] . "</td>";
echo "<td>" . $result[$i]['earnings'] . "</td></tr>";
echo "<td>" . $result[$i]['payout_status'] . "</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/DomainParkingFinalStatistics?';
/* API function parameters */
$params = [
'partnerid' => 1234,
'signkey' => 'abcdefghijklmnopqrstuvwxyz0123456789',
'username' => 'johndoe',
'password' => 'secret',
'output_method' => 'xml',
'domain' => 'example.com',
'period' => 0,
'date' => '2017-01-01',
'startfrom' => 0,
'results' => 0,
];
/* 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"?>
<SEDOSTATS ver="1.0">
<item>
<domain type="xsd:string">example.com</domain>
<date type="xsd:string">2017-01-01</date>
<visitors type="xsd:int">0</visitors>
<clicks type="xsd:int">0</clicks>
<earnings type="xsd:double">0</earnings>
<payout_status type="xsd:string">Estimated</earnings>
</item>
</SEDOSTATS>
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 SedoDomainParkingFinalStatistics
{
public static void main(String[] args) throws Exception
{
sedoapi.SedoInterfaceServiceLocator locator = new sedoapi.SedoInterfaceServiceLocator();
sedoapi.SedoInterfacePortType port = locator.getSedoInterfacePort();
try {
DomainParkingFinalStatisticsRequest request = new DomainParkingFinalStatisticsRequest();
request.setPartnerid(1234);
request.setSignkey("abcdefghijklmnopqrstuvwxyz0123456789");
request.setUsername("johndoe");
request.setPassword("secret");
request.setDomain("example.com");
request.setPeriod(0);
request.setDate("2017-01-01");
request.setStartfrom(0);
request.setResults(10);
DomainParkingFinalStatisticsResponse[] response = port.domainParkingFinalStatistics(request);
for (int i = 0; i < response.length; i++) {
System.out.println("Domain: " + response[i].getDomain());
System.out.println("Date: " + response[i].getDate());
System.out.println("Visitors: " + response[i].getVisitors());
System.out.println("Clicks: " + response[i].getClicks());
System.out.println("Earnings: " + response[i].getEarnings());
System.out.println("Payout Status: " + response[i].getPayoutStatus());
System.out.println("--------");
}
} catch (AxisFault fault) {
System.err.println("Faultcode : " + fault.getFaultCode());
System.err.println("Faultstring : " + fault.getFaultString());
}
}
}