Home » getCampaign

getCampaign

Description

Gets campaign with given id

Attributes

FieldTypeDescriptionRequired
CampaignIdintcampaign IDtrue

Samples

Java

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

public class GetCampaignTest {

    public static void main(String[] args) {
        GetCampaignTest.getCampaignTest();
    }

    private static void getCampaignTest() {
        
        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);
                       
            GetCampaign gc = new GetCampaign();
            gc.setId(320315);
            Thread.sleep(5000);
            Campaign c = stub.getCampaign(gc).get_return();
    
            System.out.println("GET_CAMPAIGN COMPLETE!");
            System.out.println("PLEASE: " + c.getId() + " " + c.getName());

        } catch (Exception e) {
            System.err.println("ERROR: GET_CAMPAIGN 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 
         */
        $campaign_id = 1350191;
        $param = new getCampaign($campaign_id);
        
        /**
         *Execute API Call 
         */
        try {
                $response = $stub->getCampaign($param);
        }catch (SoapFault $ex) {
          var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "GET CAMPAIGN FAILED\n";
            die();
        }
        
        /**
         * Response
         */
        $tmp = new getCampaignResponse($response);
        $campaign = $tmp->return;
        echo "GET CAMPAIGN COMPLETE - RESPONSE : \n";
        print_r($campaign);

SOAP

Request

POST /axis2/services/ZEDOAPI?wsdl HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:getCampaign"
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:getCampaign xmlns:ns5="http://zapi.zedo.com">
<ns5:id>1173689</ns5:id>
</ns5:getCampaign>
</soapenv:Body>
</soapenv:Envelope>

Response

HTTP/1.1 200 OK
Date: Thu, 21 Jan 2016 04:57:56 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8; action="urn:getCampaignResponse"
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:getCampaignResponse 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.Campaign">
<ax24:actionType>1</ax24:actionType>
<ax24:actionsAllocated>0</ax24:actionsAllocated>
<ax24:actionsDelivered>0</ax24:actionsDelivered>
<ax24:advertiserId>1173688</ax24:advertiserId>
<ax24:allocateByDay>0</ax24:allocateByDay>
<ax24:allocateType>ad</ax24:allocateType>
<ax24:allocationAtCampaign xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
<ax24:autoOptimization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
<ax24:categoryType>0</ax24:categoryType>
<ax24:clicksAllocated>1000</ax24:clicksAllocated>
<ax24:clicksDelivered>0</ax24:clicksDelivered>
<ax24:cost>1.0</ax24:cost>
<ax24:createdBy>41107</ax24:createdBy>
<ax24:createdDate>2016-01-20 04:28:20</ax24:createdDate>
<ax24:daysTargeted xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
<ax24:deliveryType>S</ax24:deliveryType>
<ax24:distributeBy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
<ax24:endDate>2016-05-05 23:59:59</ax24:endDate>
<ax24:endTime>23:59</ax24:endTime>
<ax24:eventAssigned xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
<ax24:eventsDelivered>0</ax24:eventsDelivered>
<ax24:exclusive>1</ax24:exclusive>
<ax24:id>1173689</ax24:id>
<ax24:impressionsAllocated>1000</ax24:impressionsAllocated>
<ax24:impressionsDelivered>0</ax24:impressionsDelivered>
<ax24:inventoryType>Premium</ax24:inventoryType>
<ax24:ioReference>
</ax24:ioReference>
<ax24:level>60</ax24:level>
<ax24:limitAt>AT_AD_LEVEL</ax24:limitAt>
<ax24:limitType>0</ax24:limitType>
<ax24:minimumThreshold xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
<ax24:modifiedBy>41107</ax24:modifiedBy>
<ax24:modifiedDate>2016-01-20 04:28:20</ax24:modifiedDate>
<ax24:name>20131234augtesting</ax24:name>
<ax24:notes>
</ax24:notes>
<ax24:oldCost>0.0</ax24:oldCost>
<ax24:recomputeEarningsFlag>0</ax24:recomputeEarningsFlag>
<ax24:revenueDistributionMethod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
<ax24:revenueType>CPA</ax24:revenueType>
<ax24:startDate>2015-07-29 18:00:00</ax24:startDate>
<ax24:startTime>00:00</ax24:startTime>
<ax24:status>A</ax24:status>
<ax24:timezoneId>1</ax24:timezoneId>
<ax24:updateFlag>0</ax24:updateFlag>
<ax24:weight>100.0</ax24:weight>
</ns:return>
</ns:getCampaignResponse>
</soapenv:Body>
</soapenv:Envelope>