Basic API GetPreviewLink

Synopsis
public array GetPreviewLink( array $list )
Description

Used to return a preview link for parked domain names.

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.
string $domain yes Domain name in ACE format.
string $keyword yes Keyword.
integer $template no Template ID. See GetParkingTemplateList .
string $market no Keyword market. See Sedo Keyword Markets .
string $searchbox no Show search box. (Y or N)
string $relatedlinks no Show related links. (Y or N) deprecated
Returns
Type Description
string Preview link.
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',
        'domain'       => 'example.com',
        'keyword'      => 'example',
        'template'     => 3000,
        'market'       => 'end',
        'searchbox'    => 'Y',
        'relatedlinks' => 'Y',
    ];

    // Call the SOAP method
    $result = $client->GetPreviewLink($params);

    // Display the result
    var_dump($result);

} catch (SoapFault $e) {
    echo 'Error: '.$e->getMessage();
}
<?php
/* URL to Sedo's API */
$baseUrl = 'https://api.sedo.com/api/v1/GetPreviewLink?';

/* API function parameters */
$params = [
    'partnerid'     => 1234,
    'signkey'       => 'abcdefghijklmnopqrstuvwxyz0123456789',
    'output_method' => 'xml',
    'domain'        => 'example.com',
    'keyword'       => 'example',
    'template'      => 3000,
    'market'        => 'end',
    'searchbox'     => 'Y',
    'relatedlinks'  => 'Y',
];

/* 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"?>
<SEDOPREVIEWLINK ver="1.0">
    <preview>xxxxxxx</preview>
</SEDOPREVIEWLINK>

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>