Service Provider API GetAccountData

Synopsis
public array GetAccountData( array $member )
Description

Returns account details of a Sedo customer account.

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 $username yes User name. (max. 25 characters)
string $password yes Password. (max. 16 characters)
Returns
Type Description
array

Array of the following customer data:

Type Key Description
string username User name.
string email Email address.
string firstname First name.
string lastname Last name.
string company Company name.
string street Street address.
string zipcode ZIP code.
string city City name.
string state ISO 3166-2 two-letter state code. See US States.
string country ISO 3166-1 alpha-2 two-letter country code. See Countries.
string language ISO 639-1 two-letter language code. See Domain Languages.
string vat VAT (Value Added Tax) number.
string phone Phone number.
double parkingearnings Parking earnings.
integer currency Currency of the parking earnings.
  • 0 - EUR
  • 1 - USD
  • 2 - GBP
integer domaincount Number of all known domains of this customer.
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',
    ];

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

    // Display the result
    while (list ($key, $val) = each ($result))
    {
        echo "$key => $val<br />\n";
    }
} catch (SoapFault $e) {
    echo 'Error: '.$e->getMessage();
}
<?php
/* URL to Sedo's API */
$baseUrl = 'https://api.sedo.com/api/v1/GetAccountData?';

/* API function parameters */
$params = [
    'partnerid'     => 1234,
    'signkey'       => 'abcdefghijklmnopqrstuvwxyz0123456789',
    'username'      => 'johndoe',
    'password'      => 'secret',
    'output_method' => 'xml',
];

/* 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"?>
<SEDOACCOUNTDATA ver="1.0">
    <username type="xsd:string">johndoe</username>
    <email type="xsd:string">john.doe@example.com</email>
    <firstname type="xsd:string">John</firstname>
    <lastname type="xsd:string">Doe</lastname>
    <company type="xsd:string">ACME</company>
    <street type="xsd:string">Main Road 47</street>
    <zipcode type="xsd:string">54321</zipcode>
    <city type="xsd:string">Racoon City</city>
    <state type="xsd:string">UC</state>
    <country type="xsd:string">US</country>
    <language type="xsd:string">en</language>
    <vat type="xsd:string"></vat>
    <phone type="xsd:string">5552368</phone>
    <parkingearnings type="xsd:double">47.11</parkingearnings>
    <currency type="xsd:int">1</currency>
</SEDOACCOUNTDATA>

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 SedoAccountData
{
    public static void main(String[] args) throws Exception
    {
        sedoapi.SedoInterfaceServiceLocator locator = new sedoapi.SedoInterfaceServiceLocator();
        sedoapi.SedoInterfacePortType port = locator.getSedoInterfacePort();

        try {
            AccountDataRequest request = new AccountDataRequest();

            request.setPartnerid(1234);
            request.setSignkey("abcdefghijklmnopqrstuvwxyz0123456789");
            request.setUsername("johndoe");
            request.setPassword("secret");

            AccountDataResponse response = port.getAccountData(request);

            System.out.println("Username: " + response.getUsername());
            System.out.println("Email: " + response.getEmail());
            System.out.println("Firstname: " + response.getFirstname());
            System.out.println("Lastname: " + response.getLastname());
            System.out.println("Company: " + response.getCompany());
            System.out.println("Street: " + response.getStreet());
            System.out.println("Zipcode: " + response.getZipcode());
            System.out.println("City: " + response.getCity());
            System.out.println("State: " + response.getState());
            System.out.println("Country: " + response.getCountry());
            System.out.println("Language: " + response.getLanguage());
            System.out.println("Vat: " + response.getVat());
            System.out.println("Phone: " + response.getPhone());
            System.out.println("Parkingearnings: " + response.getParkingearnings());
            System.out.println("Currency: " + response.getCurrency());
        } catch (AxisFault fault) {
            System.err.println("Faultcode : " + fault.getFaultCode());
            System.err.println("Faultstring : " + fault.getFaultString());
        }
    }
}