Home » updateCompetingCampaign

updateCompetingCampaign

Description

In order to update the competing parameters , use this function.

– 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.*;
import com.zedo.zapi.ZEDOAPIStub;
public class UpdateCompetingCampaign {
 
 public static void main(String[] args) {
 UpdateCompetingCampaign.updateCompetingCampaign();
 }

 private static void updateCompetingCampaign() {
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);

 ZEDOAPIStub.CompetingCampaignMap ccm = new ZEDOAPIStub.CompetingCampaignMap();
 
 ccm.setCampaign_id(3073965);
 ZEDOAPIStub.CompetingCampaign[] cc = new ZEDOAPIStub.CompetingCampaign[3];
 cc[0]= new ZEDOAPIStub.CompetingCampaign();
 cc[0].setCampaign_id(3074010);
 cc[0].setStatus("A");
 
 cc[1]= new ZEDOAPIStub.CompetingCampaign();
 cc[1].setCampaign_id(3073966);
 cc[1].setStatus("I");
 
 cc[2]= new ZEDOAPIStub.CompetingCampaign();
 cc[2].setCampaign_id(3073964);
 cc[2].setStatus("I");
 
 ccm.setSelfCompeting(false);
 ccm.setCompetingCampaign(cc);
 
 ZEDOAPIStub.UpdateCompetingCampaign param = new ZEDOAPIStub.UpdateCompetingCampaign();
 param.setCompetingCampaignMap(ccm);
 Thread.sleep(1000);
 ZEDOAPIStub.UpdateCompetingCampaignResponse sccr = stub.updateCompetingCampaign(param);
 System.out.println("UPDATE_COMPETING_CAMPAIGN_COMPLETE COMPLETE!");
 
 } catch (Exception e) {
 System.err.println("ERROR:Update_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', 'example@zedo.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 
 */

 $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;

 print_r($competingCampaignMap);

 $param = new UpdateCompetingCampaign($competingCampaignMap);
 /**
 *Execute API Call 
 */
 try {
 print_r($param);
 $response = $stub->updateCompetingCampaign($param);
 } catch (SoapFault $ex) {
 var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
 echo "UPDATE CompetingCampaignMap FAILED\n";
 die();
 }

 /**
 * Response
 */
 echo "UPDATE 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:updateCompetingCampaign"
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:updateCompetingCampaign 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>I</status>
</competingCampaign>
<ns1:selfCompeting xmlns:ns1="http://client.api.zedo.com/xsd">false</ns1:selfCompeting>
</ns5:competingCampaignMap>
</ns5:updateCompetingCampaign>
</soapenv:Body>
</soapenv:Envelope>

Response

HTTP/1.1 200 OK
Date: Wed, 20 Jan 2016 07:48:21 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8; action="urn:updateCompetingCampaignResponse"
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:updateCompetingCampaignResponse 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>I</ax24:status>
</ax24:competingCampaign>
<ax24:selfCompeting>false</ax24:selfCompeting>
</ns:return>
</ns:updateCompetingCampaignResponse>
</soapenv:Body>
</soapenv:Envelope>