Home » getCompetingCampaign

getCompetingCampaign

Description

This function gets the competing campaign based on parent campaign_id.

Attributes

FieldTypeDescriptionRequired
CampaignIdintcampaign IDtrue

Samples

Java

package com.zedo.zapi.zclients.campaign;

import java.sql.Timestamp;
import java.util.Date;

import com.zedo.zapi.zclients.config.*;
import com.zedo.zapi.*;
import com.zedo.zapi.ZEDOAPIStub.CompetingCampaign;
import com.zedo.zapi.ZEDOAPIStub.CompetingCampaignMap;
import com.zedo.zapi.ZEDOAPIStub.*;

import javax.xml.namespace.QName;

import org.apache.axis2.AxisFault;


public class GetCompetingCampaignTest {

 public static void main(String[] args) {
 GetCompetingCampaignTest.getCompetingCampaignTest();
 }
 private static void getCompetingCampaignTest() {
 
 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);
 
 Thread.sleep(5000);
 ZEDOAPIStub.GetCompetingCampaign param = new ZEDOAPIStub.GetCompetingCampaign();
 
 param.setCampaign_id(1124831);
 ZEDOAPIStub.GetCompetingCampaignResponse res= stub.getCompetingCampaign(param);
 CompetingCampaignMap cc= res.get_return();
 
 System.out.println("Get Competing Campaign All Complete!");
 System.out.println("campaign id:"+cc.getCampaign_id());
 for(CompetingCampaign competingcampaign:cc.getCompetingCampaign()) {
 
 System.out.println("campaign id: "+competingcampaign.getCampaign_id());
 System.out.println("Status: "+competingcampaign.getStatus());
 }
 
 System.out.println("Self Competing:" +cc.getSelfCompeting());
 
 } catch (Exception e) {
 System.err.println("ERROR: Get Competing 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', '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 
 */
 $campaign_id = 3235009;
 $param = new getCompetingCampaign($campaign_id);
 
 /**
 *Execute API Call 
 */
 try {
 $response = $stub->getCompetingCampaign($param);
 }catch (SoapFault $ex) {
 var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
 echo "GET COMPETING CAMPAIGN FAILED\n";
 die();
 }
 
 /**
 * Response
 */
 $tmp = new getCompetingCampaignResponse($response);
 $getCompetingCampaignMap = $tmp->return;
 echo "GET COMPETING CAMPAIGN COMPLETE - RESPONSE : \n";
 print_r($getCompetingCampaignMap);

SOAP

Request

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

Response

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