public array CheckBlacklist( array $blacklist )
Returns whether a domain is blacklisted at Sedo.
Type | Parameter | Mandatory | Description |
---|---|---|---|
integer | $partnerid | yes | Partner ID. |
string | $signkey | yes | Sign key. |
array | $blacklist | yes | Array of domain names in ACE format. |
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',
'blacklist' => ['example.com', 'example.net'],
];
// Call the SOAP method
$result = $client->CheckBlacklist($params);
// Display the result
for ($i = 0; $i < count($result); $i++) {
echo "Domain: ".$result[$i]['domain']."<br>";
echo "Is Blacklisted: ".$result[$i]['blacklisted']."<br>";
echo "Status: ".$result[$i]['status']."<br>";
echo "Message: ".$result[$i]['message']."<br>";
echo "---------------<br><br>";
}
} catch (SoapFault $e) {
echo 'Error: '.$e->getMessage();
}
<?php
/* URL to Sedo's API */
$baseUrl = 'https://api.sedo.com/api/v1/CheckBlacklist?';
/* API function parameters */
$params = [
'partnerid' => 1234,
'signkey' => 'abcdefghijklmnopqrstuvwxyz0123456789',
'username' => 'johndoe',
'password' => 'secret',
'output_method' => 'xml',
'keywordentry' => ['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"?>
<SEDOCHECKBLACKLIST ver="1.0">
<item>
<domain type="xsd:string">example.com</domain>
<blacklisted type="xsd:boolean">1</blacklisted>
<status type="xsd:string"></status>
<message type="xsd:string"></message>
</item>
</SEDOCHECKBLACKLIST>
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>