Home » searchCreative

searchCreative

Description

Searches the creatives using the filter specified.

Attributes

FieldTypeRequired
CreativeSearchBeanCreativeSearchBeanTrue

CreativeSearchBean

FieldTypeDescriptionRequired
CustomTargetingFilterCustomTargetingFilter[ ]The key-value pairs used to search creativesTrue

Samples

Java

package com.zedo.zapi.zclients.search;
import javax.xml.namespace.QName;

import org.apache.axis2.AxisFault;
import com.zedo.zapi.ZEDOAPIStub;
import com.zedo.zapi.ZEDOAPIStub.Creative;

public class CreativeCustomTargetingKeyValueSearch {
 
 public static void main(String[] args) {
 CreativeCustomTargetingKeyValueSearch.SearchTest();
 }
 
 private static void SearchTest() {
 
 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.CustomTargetingFilter[] customTargetingFilter = new ZEDOAPIStub.CustomTargetingFilter[3];
 
 customTargetingFilter[0] = new ZEDOAPIStub.CustomTargetingFilter();
 customTargetingFilter[0].setKey("date");
 String[] words={"10/08/2015","10/07/2015"};
 customTargetingFilter[0].setValues(words);
 
 customTargetingFilter[1] = new ZEDOAPIStub.CustomTargetingFilter();
 customTargetingFilter[1].setKey("Band");
 String[] words1={"rocknroll"};
 customTargetingFilter[1].setValues(words1);
 
 customTargetingFilter[2] = new ZEDOAPIStub.CustomTargetingFilter();
 customTargetingFilter[2].setKey("city");
 String[] words2={"Mumbai","DELHI"};
 customTargetingFilter[2].setValues(words2);
 
 ZEDOAPIStub.CreativeSearchBean bean = new ZEDOAPIStub.CreativeSearchBean();
 bean.setCustomTargetingFilter(customTargetingFilter);
 
 ZEDOAPIStub.SearchCreative sc = new ZEDOAPIStub.SearchCreative();
 sc.setCreativeSearchBean(bean);
 
 ZEDOAPIStub.SearchCreativeResponse res = stub.searchCreative(sc);
 
 System.out.println("SEARCH COMPLETE!");
 for(Creative c: res.get_return()) {
 System.out.println("Creative id:"+ c.getId()+" name:"+c.getName());
 }

 } catch (Exception e) {
 System.err.println("ERROR: SEARCH 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

<?php

include_once './zlib/ZEDOAPI.php';

$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
$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','480');
$header[3] = new SoapHeader('http://api.zedo.com','callinfo','zapiCall');
$stub2 = new ZEDOAPI($config);
$stub2->__setSoapHeaders($header);


$creativeSearchBean = new CreativeSearchBean();

 $customTargetingFilter = Array();
 $customTargetingFilter[0] = new CustomTargetingFilter();
 $customTargetingFilter[0]->key = "date";
 $words=array("10/08/2015","10/07/2015");
 $customTargetingFilter[0]->values = $words;

 $customTargetingFilter[1]=new CustomTargetingFilter();
 $customTargetingFilter[1]->key = "Band";
 $words1=array("rocknroll");
 $customTargetingFilter[1]->values = $words1;

 $customTargetingFilter[2]=new CustomTargetingFilter();
 $customTargetingFilter[2]->key = "city";
 $words2=array("Mumbai","DELHI");
 $customTargetingFilter[2]->values = $words2;


 $creativeSearchBean->customTargetingFilter = $customTargetingFilter;


 $param = new searchCreative($creativeSearchBean);

 /**
 * Execute API Call 
 */
 try {
 $response = $stub2->searchCreative($param);
print_r($response);
 } catch (SoapFault $ex) {
 var_dump($ex);
 $error_msg="Failed while searching Ads \n";
 $error_msg .= "FaultCode: " . $ex->faultcode . " FaultString: " . $ex->faultstring." Details: ".print_r($ex->detail,true);
 
 die();
 }

SOAP

Request

POST /axis2/services/ZEDOAPI?wsdl HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:searchCreative"
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:searchCreative xmlns:ns5="http://zapi.zedo.com">
<ns5:creativeSearchBean>
<customTargetingFilter xmlns="http://client.api.zedo.com/xsd">
<key>new_age</key>
<values>2</values>
</customTargetingFilter>
<customTargetingFilter xmlns="http://client.api.zedo.com/xsd">
<key>income</key>
</customTargetingFilter>
</ns5:creativeSearchBean>
</ns5:searchCreative>
</soapenv:Body>
</soapenv:Envelope>

Response

HTTP/1.1 200 OK
Date: Wed, 20 Jan 2016 07:40:17 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8; action="urn:searchCreativeResponse"
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:searchCreativeResponse xmlns:ns="http://zapi.zedo.com" 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">
<ns:return type="com.zedo.api.client.Creative">
<ax24:actionsAllocated>0</ax24:actionsAllocated>
<ax24:actionsDelivered>0</ax24:actionsDelivered>
<ax24:actionsDelta>0</ax24:actionsDelta>
<ax24:allocateByDay>-1</ax24:allocateByDay>
<ax24:altText>
</ax24:altText>
<ax24:attributes>0</ax24:attributes>
<ax24:booked>0</ax24:booked>
<ax24:campaignId>1086373</ax24:campaignId>
<ax24:clickThroughURL>http://</ax24:clickThroughURL>
<ax24:clicksAllocated>0</ax24:clicksAllocated>
<ax24:clicksDelivered>0</ax24:clicksDelivered>
<ax24:clicksDelta>0</ax24:clicksDelta>
<ax24:dimensionId>0</ax24:dimensionId>
<ax24:eventsAllocated>0</ax24:eventsAllocated>
<ax24:eventsDelivered>0</ax24:eventsDelivered>
<ax24:eventsDelta>0</ax24:eventsDelta>
<ax24:frequency>0</ax24:frequency>
<ax24:genQueuePosition>0</ax24:genQueuePosition>
<ax24:geoPriority>0</ax24:geoPriority>
<ax24:geoType>NONE</ax24:geoType>
<ax24:id>858764</ax24:id>
<ax24:impressionsAllocated>-1</ax24:impressionsAllocated>
<ax24:impressionsDelivered>0</ax24:impressionsDelivered>
<ax24:impressionsDelta>0</ax24:impressionsDelta>
<ax24:name>nnnn</ax24:name>
<ax24:piactionsDelivered>0</ax24:piactionsDelivered>
<ax24:piactionsDelta>0</ax24:piactionsDelta>
<ax24:profileType>0</ax24:profileType>
<ax24:status>NYA</ax24:status>
<ax24:timezoneId>1</ax24:timezoneId>
<ax24:type>Std Banner</ax24:type>
<ax24:uploadDelta>0</ax24:uploadDelta>
<ax24:uploadTick>0</ax24:uploadTick>
<ax24:version>1</ax24:version>
<ax24:weight>0</ax24:weight>
</ns:return>
</ns:searchCreativeResponse>
</soapenv:Body>
</soapenv:Envelope>