public array CheckMember( array $member )
Returns whether a person is a Sedo customer or not.
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) |
Type | Description |
---|---|
integer | 1 if the customer exists at Sedo, 0 otherwise. |
<?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->CheckMember($params);
// Display the result
if (1 == $result) {
echo 'Customer exists';
} else {
echo "Customer doesn't exist";
}
} catch (SoapFault $e) {
echo 'Error: '.$e->getMessage();
}
<?php
/* URL to Sedo's API */
$baseUrl = 'https://api.sedo.com/api/v1/CheckMember?';
/* 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"?>
<SEDOCHECKMEMBER ver="1.0">
<member type="xsd:int">1</member>
</SEDOCHECKMEMBER>
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 SedoCheckMember
{
public static void main(String[] args) throws Exception
{
sedoapi.SedoInterfaceServiceLocator locator = new sedoapi.SedoInterfaceServiceLocator();
sedoapi.SedoInterfacePortType port = locator.getSedoInterfacePort();
try {
CheckMemberRequest request = new CheckMemberRequest();
request.setPartnerid(1234);
request.setSignkey("abcdefghijklmnopqrstuvwxyz0123456789");
request.setUsername("johndoe");
request.setPassword("secret");
try {
int response = (int) port.checkMember(request);
if (response == 1) {
System.out.println("User exists");
} else {
System.out.println("User doesn't exist");
}
} catch (NullPointerException ex) {
ex.printStackTrace();
}
} catch (AxisFault fault) {
System.err.println("Faultcode : " + fault.getFaultCode());
System.err.println("Faultstring : " + fault.getFaultString());
}
}
}