Home » getCampaignAll

getCampaignAll

Description

Gets the campaign list with access control privileges

Attibutes

Function doesn’t accept attributes

Samples

Java

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

public class GetCampaignAllTest {

    public static void main(String[] args) {
        GetCampaignAllTest.getCampaignAllTest();
    }

    private static void getCampaignAllTest() {
        
        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"),  "480");
            stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(10 * 60 * 1000);
            
            Thread.sleep(5000);
            Campaign[] campaignAll = stub.getCampaignAll().get_return();
     
            System.out.println("GET_CAMPAIGN_ALL COMPLETE!");
            for (Campaign campaign : campaignAll) {
                System.out.println(campaign.getId() + " " + campaign.getName());
            }

        } catch (Exception e) {
            System.err.println("ERROR: GET_CAMPAIGN_ALL 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 
         */
        
        /**
         *Execute API Call 
         */
        try {
                $response = $stub->getCampaignAll();
        }catch (SoapFault $ex) {
            var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "GET CAMPAIGN ALL FAILED\n";
            die();
        }

/**
 * Response
 */
$tmp = new getCampaignAllResponse($response);
$campaignAll = $tmp->return;
echo "GET CAMPAIGN ALL COMPLETE - RESPONSE : \n";
print_r($campaignAll);

SOAP

Request

POST /axis2/services/ZEDOAPI HTTP/1.0 Host: 172.16.1.9:8080 User-Agent: NuSOAP/0.7.2 (1.3) Content-Type: text/xml; charset=ISO-8859-1 SOAPAction: "urn:getCampaignAll" Content-Length: 597<? xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header>
<zedoapi:user xmlns="http://zapi.zedo.com">user@domain.com</zedoapi:user>
<zedoapi:password xmlns="http://zapi.zedo.com">mypassword</zedoapi:password>
<zedoapi:network xmlns="http://zapi.zedo.com">525</zedoapi:network>
<zedoapi:callinfo xmlns="http://zapi.zedo.com">zapiCall</zedoapi:callinfo>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response

HTTP/1.0 200 OK Date: Thu, 10 May 2007 19:50:40 GMT Server: Simple-Server/1.1 Content-Length: 265368 Content-Type: text/xml; charset=ISO-8859-1<? xml version='1.0' encoding='ISO-8859-1'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header />
<soapenv:Body>
<ns:getCampaignAllResponse xmlns:ns="http://zapi.zedo.com">
<ns:return>
<actionType xmlns="http://client.api.zedo.com/xsd">0</actionType>
<actionsAllocated xmlns="http://client.api.zedo.com/xsd">0</actionsAllocated>
<actionsDelivered xmlns="http://client.api.zedo.com/xsd">0</actionsDelivered>
<advertiserId xmlns="http://client.api.zedo.com/xsd">173865</advertiserId>
<allocateByDay xmlns="http://client.api.zedo.com/xsd">0</allocateByDay>
<allocateType xmlns="http://client.api.zedo.com/xsd">ad</allocateType>
<assetId xmlns="http://client.api.zedo.com/xsd">251400</assetId>
<categoryType xmlns="http://client.api.zedo.com/xsd">0</categoryType>
<clicksAllocated xmlns="http://client.api.zedo.com/xsd">0</clicksAllocated>
<clicksDelivered xmlns="http://client.api.zedo.com/xsd">0</clicksDelivered>
<cost xmlns="http://client.api.zedo.com/xsd">1.0</cost>
<createdBy xmlns="http://client.api.zedo.com/xsd">user@domain.com</createdBy>
<createdDate xmlns="http://client.api.zedo.com/xsd">2006-08-31 00:00:00</createdDate>
<deliveryType xmlns="http://client.api.zedo.com/xsd">E</deliveryType>
<endDate xmlns="http://client.api.zedo.com/xsd">2006-09-08 00:00:00</endDate>
<impressionsAllocated xmlns="http://client.api.zedo.com/xsd">0</impressionsAllocated>
<impressionsDelivered xmlns="http://client.api.zedo.com/xsd">0</impressionsDelivered>
<inventoryType xmlns="http://client.api.zedo.com/xsd">Premium</inventoryType>
<level xmlns="http://client.api.zedo.com/xsd">110</level>
<limitType xmlns="http://client.api.zedo.com/xsd">0</limitType>
<modifiedBy xmlns="http://client.api.zedo.com/xsd">user@domain.com</modifiedBy>
<modifiedDate xmlns="http://client.api.zedo.com/xsd">2006-08-31 00:00:00</modifiedDate>
<name xmlns="http://client.api.zedo.com/xsd">flash backups</name>
<notes xmlns="http://client.api.zedo.com/xsd">Testing flash backup allocation</notes>
<oldCost xmlns="http://client.api.zedo.com/xsd">1.0</oldCost>
<recomputeEarningsFlag xmlns="http://client.api.zedo.com/xsd">0</recomputeEarningsFlag>
<revenueType xmlns="http://client.api.zedo.com/xsd">CPM</revenueType>
<startDate xmlns="http://client.api.zedo.com/xsd">2006-08-30 00:00:00</startDate>
<status xmlns="http://client.api.zedo.com/xsd">A</status>
<timezoneId xmlns="http://client.api.zedo.com/xsd">1</timezoneId>
<updateFlag xmlns="http://client.api.zedo.com/xsd">0</updateFlag>
<weight xmlns="http://client.api.zedo.com/xsd">100</weight>
</ns:return>
</ns:getCampaignAllResponse>
</soapenv:Body>
<soapenv:Envelope>