Home » setCompetingCampaign

setCompetingCampaign

Description

After a campaign is created, use this function to set a campaign as competing with others or self.

– If selfCompeting is set to true than the parent campaign will compete with itself.

– If selfCompeting is set to false and competingCampaign[ ] has entries than parent campaign_id will compete with each entry in competing campaign[ ]

– If selfCompeting is set to true and competingCampaign[ ] has entries then parent campaign will compete with itself. Also parent campaign will compete with every campaign in competingCampaign[ ].

 

Attributes

FieldTypeRequired
CompetingCampaignMapCompetingCampaignMapTrue

 

CompetingCampaignMap

FieldTypeDescriptionRequired
campaign_idintCampaign Id of the parent campaign which will competetrue
competingCampaignCompetingCampaign [ ]Campaigns with whom parent campaign will compete againstfalse
selfCompetingbooleanIndicates whether the parent campaign is competing with itselffalse

 

Samples

Java

package com.zedo.zapi.zclients.campaign;

import javax.xml.namespace.QName;

import org.apache.axis2.AxisFault;

import com.zedo.zapi.zclients.config.Config;
import com.zedo.zapi.ZEDOAPIStub;
import com.zedo.zapi.ZEDOAPIStub.CompetingCampaign;

public class CreateCompetingCampaign {

	public static void main(String[] args) {
		CreateCompetingCampaign.createCompetingCampaignTest();
	}
	
	private static void createCompetingCampaignTest() {
try {
	
            
			ZEDOAPIStub stub = new ZEDOAPIStub(Config.getProperty("wsdl"));	//Local
        	stub._getServiceClient().addStringHeader(new QName("http://api.zedo.com", "user", "zedoapi"),Config.getProperty("username"));
            stub._getServiceClient().addStringHeader(new QName("http://api.zedo.com", "password", "zedoapi"),Config.getProperty("password"));
            stub._getServiceClient().addStringHeader(new QName("http://api.zedo.com", "network", "zedoapi"),Config.getProperty("network"));
           
			stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(10 * 60 * 1000);
	
			ZEDOAPIStub.CompetingCampaignMap ccm = new ZEDOAPIStub.CompetingCampaignMap();
			
			ccm.setCampaign_id(3073965);
			
			ZEDOAPIStub.CompetingCampaign[] cc = new ZEDOAPIStub.CompetingCampaign[2];
			cc[0]= new ZEDOAPIStub.CompetingCampaign();
			cc[0].setCampaign_id(3073966);
			cc[0].setStatus("A");
			
			cc[1]= new ZEDOAPIStub.CompetingCampaign();
			cc[1].setCampaign_id(3073964);
			cc[1].setStatus("A");
			
/*			cc[2]= new ZEDOAPIStub.CompetingCampaign();
			cc[2].setCampaign_id(669609);
			cc[2].setStatus("A");
*/
			ccm.setCompetingCampaign(cc);
			ccm.setSelfCompeting(true);
			
			ZEDOAPIStub.SetCompetingCampaign param = new ZEDOAPIStub.SetCompetingCampaign();
			
			param.setCompetingCampaignMap(ccm);
			//param.setParam1(cc);
			Thread.sleep(1000);
	        ZEDOAPIStub.SetCompetingCampaignResponse sccr = stub.setCompetingCampaign(param);
	        System.out.println("CREATE_COMPETING_CAMPAIGN_COMPLETE COMPLETE!");
	        System.out.println("PLEASE: " + sccr.get_return().getCampaign_id()+" ");
	        
	        
			
	} catch (Exception e) {
		System.err.println("ERROR:CREATE_COMPETING_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', 'vishalv@zedo.com');
 $header[1] = new SoapHeader('http://api.zedo.com','password', 'ozocom123');
 $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 
 */
 
 $competingCampaignMap = new CompetingCampaignMap();
 
 $competingCampaignMap->campaign_id=3235009;
 $competingcampaignMap->selfCompeting=true;

 $competingCampaign = Array();
 $competingCampaign[0] = new CompetingCampaign();
 $competingCampaign[0]->campaign_id=2780178;
 $competingCampaign[0]->status="A";

 $competingCampaign[1] = new CompetingCampaign();
 $competingCampaign[1]->campaign_id=3096534; 
 $competingCampaign[1]->status="A";
 $competingCampaignMap->competingCampaign=$competingCampaign;
 
 $param = new SetCompetingCampaign($competingCampaignMap);
 
 /**
 *Execute API Call 
 */
 try {
 $response = $stub->setCompetingCampaign($param);
 } catch (SoapFault $ex) {
 var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
 echo "CREATE CompetingCampaignMap FAILED\n";
 die();
 }
 
 /**
 * Response
 */
 echo "CREATE CompetingCampaignMap COMPLETE\n\n";
 echo "\nReponse:\n";
 echo $stub->__getLastResponse();

SOAP

Request

POST /axis2/services/ZEDOAPI?wsdl HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:setCompetingCampaign"
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:setCompetingCampaign xmlns:ns5="http://zapi.zedo.com">
<ns5:competingCampaignMap>
<ns1:campaign_id xmlns:ns1="http://client.api.zedo.com/xsd">1054016</ns1:campaign_id>
<competingCampaign xmlns="http://client.api.zedo.com/xsd">
<campaign_id>1105815</campaign_id>
<status>A</status>
</competingCampaign>
<ns1:selfCompeting xmlns:ns1="http://client.api.zedo.com/xsd">true</ns1:selfCompeting>
</ns5:competingCampaignMap>
</ns5:setCompetingCampaign>
</soapenv:Body>
</soapenv:Envelope>

Response

HTTP/1.1 200 OK
Date: Wed, 20 Jan 2016 07:46:14 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8; action="urn:setCompetingCampaignResponse"
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:setCompetingCampaignResponse 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.CompetingCampaignMap">
<ax24:campaign_id>1054016</ax24:campaign_id>
<ax24:competingCampaign type="com.zedo.api.client.CompetingCampaign">
<ax24:campaign_id>1105815</ax24:campaign_id>
<ax24:status>A</ax24:status>
</ax24:competingCampaign>
<ax24:selfCompeting>true</ax24:selfCompeting>
</ns:return>
</ns:setCompetingCampaignResponse>
</soapenv:Body>
</soapenv:Envelope>