public array DomainParkingSubIdReport( array $subidrequest )
Returns sub ID based parking 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 | $date | yes | Date in the format YYYY-MM-DD . |
boolean | $final | no |
Whether to return final data or estimated
data. Default:
Note:
Final data is available after 48 hours for customers
who signed up to receive final data. Spam deductions
may take place at the end of the month.
|
integer | $startfrom | yes | Start position. |
integer | $results | yes |
Number of results from the start position.
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',
'date' => '2017-01-01',
'final' => false,
'startfrom' => 0,
'results' => 10,
];
// Call the SOAP method
$result = $client->DomainParkingSubIdReport($params);
// Display the result
echo "<table>";
echo "<tr>";
echo "<td>Date</td>";
echo "<td>Domain</td>";
echo "<td>Sub ID 1</td>";
echo "<td>Sub ID 2</td>";
echo "<td>Sub ID 3</td>";
echo "<td>Uniques</td>";
echo "<td>Clicks</td>";
echo "<td>Earnings</td>";
echo "</tr>";
for ($i = 0; $i < count($result); $i++) {
echo "<tr>";
echo "<td>".$result[$i]['date']."</td>";
echo "<td>".$result[$i]['domain']."</td>";
echo "<td>".$result[$i]['c1']."</td>";
echo "<td>".$result[$i]['c2']."</td>";
echo "<td>".$result[$i]['c3']."</td>";
echo "<td>".$result[$i]['uniques']."</td>";
echo "<td>".$result[$i]['clicks']."</td>";
echo "<td>".$result[$i]['earnings']."</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/DomainParkingSubIdReport?';
/* API function parameters */
$params = [
'partnerid' => 1234,
'signkey' => 'abcdefghijklmnopqrstuvwxyz0123456789',
'username' => 'johndoe',
'password' => 'secret',
'output_method' => 'xml',
'date' => '2017-01-01',
'final' => false,
'startfrom' => 0,
'results' => 10,
];
/* 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>
<date type="xsd:string">2017-01-01</date>
<domain type="xsd:string">example.com</domain>
<c1 type="xsd:string">subId1</c1>
<c2 type="xsd:string">subId2</c2>
<c3 type="xsd:string">subId3</c3>
<uniques type="xsd:int">0</uniques>
<clicks type="xsd:int">0</clicks>
<earnings type="xsd:double">0</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 SedoDomainParkingSubIdReport
{
public static void main(String[] args) throws Exception
{
sedoapi.SedoInterfaceServiceLocator locator = new sedoapi.SedoInterfaceServiceLocator();
sedoapi.SedoInterfacePortType port = locator.getSedoInterfacePort();
try {
DomainParkingSubIdReportRequest request = new DomainParkingSubIdReportRequest();
request.setPartnerid(1234);
request.setSignkey("abcdefghijklmnopqrstuvwxyz0123456789");
request.setUsername("johndoe");
request.setPassword("secret");
request.setDate("2017-01-01");
request.setFinal(false);
request.setStartfrom(0);
request.setResults(10);
DomainParkingSubIdReportResponse[] response = port.domainParkingSubIdReport(request);
for (int i = 0; i < response.length; i++) {
System.out.println("Date: " + response[i].getDate());
System.out.println("Domain: " + response[i].getDomain());
System.out.println("C1: " + response[i].getC1());
System.out.println("C2: " + response[i].getC2());
System.out.println("C3: " + response[i].getC3());
System.out.println("Uniques: " + response[i].getUniques());
System.out.println("Clicks: " + response[i].getClicks());
System.out.println("Earnings: " + response[i].getEarnings());
System.out.println("--------");
}
} catch (AxisFault fault) {
System.err.println("Faultcode : " + fault.getFaultCode());
System.err.println("Faultstring : " + fault.getFaultString());
}
}
}