Home » getUser

getUser

Description

Gets user with given id

Attributes

 

FieldTypeDescriptionRequired
IdintUser IDTrue

Samples

Java

import com.zedo.zapi.*;
import com.zedo.zapi.ZEDOAPIStub.*;
import javax.xml.namespace.QName;
import org.apache.axis2.AxisFault;

public class GetUserTest {

 public static void main(String[] args) {
 GetUserTest.getUserTest();
 }

 private static void getUserTest() {
 
 try {
 
 ZEDOAPIStub stub = new ZEDOAPIStub("http://api.zedo.com/v8/?wsdl&java");

 stub._getServiceClient().addStringHeader(new QName("http://api.zedo.com", "user", "zedoapi"), "example@example.com");
 stub._getServiceClient().addStringHeader(new QName("http://api.zedo.com", "password", "zedoapi"), "password");
 stub._getServiceClient().addStringHeader(new QName("http://api.zedo.com", "network", "zedoapi"), "525");
 stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(10 * 60 * 1000);
 
 GetUser gu = new GetUser();
 gu.setId(1168366); //2833766- local
 Thread.sleep(5000);
 User u = stub.getUser(gu).get_return();
 
 System.out.println("GET_USER COMPLETE!");
 System.out.println("PLEASE: " + u.getId() + " " + u.getLogin() + " "+u.getPassword());
 for(AccessEntity ae: u.getAdvertisers()) {
 System.out.println("Advertisers id:"+ae.getId()+" staus: "+ae.getStatus());
 }
 for(AccessEntity ae: u.getCampaigns()) {
 System.out.println("Campaigns id:"+ae.getId()+" staus: "+ae.getStatus());
 }


 } catch (Exception e) {
 System.err.println("ERROR: GET_USER FAILED!");
 System.err.println("Exception: " + e.getMessage());
 if (e instanceof AxisFault) {
 AxisFault af = (AxisFault) e;
 System.err.println("AxisFault's detail: " + af.getDetail());
 af.printStackTrace();
 } else {
 e.printStackTrace();
 }
 }
 }
}

PHP

include_once './zlib/ZEDOAPI.php';
        
        /**
         *Create Client Stub
         */
        $config = Array();
        $config['location'] = 'http://api.zedo.com/v8/?wsdl&php';       //URL of the SOAP server to send the request to
        $config['exceptions'] = true;                                                                                                   //Enable Exception Handling
        
        $stub = new ZEDOAPI($config);
        
        $header = Array();
        $header[0] = new SoapHeader('http://api.zedo.com','user', 'example@example.com');
        $header[1] = new SoapHeader('http://api.zedo.com','password', 'password');
        $header[2] = new SoapHeader('http://api.zedo.com','network','525');
        $header[3] = new SoapHeader('http://api.zedo.com','callinfo','zapiCall');
        
        $stub->__setSoapHeaders($header);
        
        /**
         *Define Call Parameters 
         */
        $user_id = 31327;
        $param = new getUser($user_id);
        
        /**
         *Execute API Call 
         */
        try {
                $response = $stub->getUser($param);
        } catch (SoapFault $ex) {
            var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "GET USER FAILED\n";
            die();
        }
        
        /**
         * Response
         */
        $tmp = new getUserResponse($response);
        $user = $tmp->return;
        echo "GET USER COMPLETE - RESPONSE : \n";
        print_r($user);

SOAP

Request

POST /axis2/services/ZEDOAPI?wsdl HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:getUser"
User-Agent: Axis2
Host: dev08.juhu.zedo.com:2000
Transfer-Encoding: chunked
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header>
<zedoapi:user xmlns:zedoapi="http://api.zedo.com">example@example.com</zedoapi:user>
<zedoapi:password xmlns:zedoapi="http://api.zedo.com">password</zedoapi:password>
<zedoapi:network xmlns:zedoapi="http://api.zedo.com">525</zedoapi:network>
</soapenv:Header>
<soapenv:Body>
<ns5:getUser xmlns:ns5="http://zapi.zedo.com">
<ns5:id>1173608</ns5:id>
</ns5:getUser>
</soapenv:Body>
</soapenv:Envelope>

Response

HTTP/1.1 200 OK
Date: Thu, 21 Jan 2016 06:19:45 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8; action="urn:getUserResponse"
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:getUserResponse xmlns:ns="http://zapi.zedo.com">
<ns:return xmlns:ax21="http://base.zedo.com/xsd" xmlns:ax22="http://util.zedo.com/xsd" xmlns:ax25="http://soap.reportengine.zedo.com/xsd" xmlns:ax24="http://client.api.zedo.com/xsd" type="com.zedo.api.client.User">
<ax24:advertisers type="com.zedo.api.client.AccessEntity">
<ax24:id>1156972</ax24:id>
<ax24:status>A</ax24:status>
</ax24:advertisers>
<ax24:browserLanguageTypeId>1</ax24:browserLanguageTypeId>
<ax24:campaigns xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
<ax24:contact type="com.zedo.api.client.Contact">
<ax24:address1>d</ax24:address1>
<ax24:address2>d</ax24:address2>
<ax24:city>r</ax24:city>
<ax24:companyName>
</ax24:companyName>
<ax24:country>w</ax24:country>
<ax24:email>efwf@af.com</ax24:email>
<ax24:fax>
</ax24:fax>
<ax24:firstName>DimaTest1</ax24:firstName>
<ax24:lastName>DimaTest2</ax24:lastName>
<ax24:phone>
</ax24:phone>
<ax24:state>
</ax24:state>
<ax24:zipCode>
</ax24:zipCode>
</ax24:contact>
<ax24:id>1173608</ax24:id>
<ax24:login>test12389@zedo.com</ax24:login>
<ax24:password>hello</ax24:password>
<ax24:publishers type="com.zedo.api.client.AccessEntity">
<ax24:id>586328</ax24:id>
<ax24:status>A</ax24:status>
</ax24:publishers>
<ax24:roleId>112773</ax24:roleId>
<ax24:status>A</ax24:status>
</ns:return>
</ns:getUserResponse>
</soapenv:Body>
</soapenv:Envelope>