Service Provider API CheckBlacklist

Synopsis
public array CheckBlacklist( array $blacklist )
Description

Returns whether a domain is blacklisted at Sedo.

SOAP
This function can be called using SOAP.
XML
This function can be called using GET / POST requests.
Parameters
Type Parameter Mandatory Description
integer $partnerid yes Partner ID.
string $signkey yes Sign key.
array $blacklist yes Array of domain names in ACE format.
Returns
Type Description
array

The return value contains the following elements:

Type Key Description
string domain Domain name in ACE format.
boolean blacklisted

true if blacklisted, false otherwise.

Warning: When calling this function via GET, the return value is incorrectly converted to integer although the XML type declaration states boolean.
string status ok if everything is in order. Otherwise a fault code.
string message Empty if everything is ok. Otherwise a fault string.
Version
1.0
<?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>