Service Provider API CreatePortfolio

Synopsis
public array CreatePortfolio( array $entries )
Description

Creates a new domain portfolio.

With one function request, you can upload a maximum of 50 domains.

SOAP
This function can be called using SOAP.
Parameters
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 $portfolioname yes Name of the new portfolio.
array $domainentry yes

Array of all the data for a domain name. (max. 50 per request)

Array elements:

Type Parameter Mandatory Description
string domain yes Domain name in ACE format.
Returns
Type Description
array

The return value contains the following elements:

Type Key Description
string domain Domain name in ACE format.
string portfolioname Name of the created portfolio.
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',
        'username'      => 'johndoe',
        'password'      => 'secret',
        'portfolioname' => 'example',
        'domainentry'   => ['example.com', 'example.net'],
    ];

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

    // Display the result
    while (list ($key, $val) = each($result)) {
        echo "$key => $val<br>\n";
    }
} catch (SoapFault $e) {
    echo 'Error: '.$e->getMessage();
}