Home » getAdTag

getAdTag

Description

Deprecated. Gets the ZEDO ad tag code

Attributes

FieldNameDescriptionRequired
param0intTrue

Ad Tag Details

FieldTypeDescriptionRequiredAccepted value
channelIdintChannel IDtrue
publisherIdintID of the publisher linked to the channel.true
dimensionIdintThe id of the dimension passed in the ad tag. falseDefault is 0. Accepted values through 0 to 95.
tagTypeStringType of ad tag. falseAccepted values are "IFrameTag", "JavascriptTag", "NoscriptTag", "RedirectURLTag", "CombinedTag", "AOLTag", "MSNTag" and "YahooTag"
liteTagbooleanA special javascript tag to enable 3rd party tracking. trueAccepted values are true or false.
enableKeywordTargetingbooleanDisplays the keyword text box to allow key word targeting.false
keywordTargetingStringKeyword string passed to the ad tag.false

Samples

Java

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

public class GetAdTagTest {

    public static void main(String[] args) {
        GetAdTagTest.getAdTagTest();
    }

    private static void getAdTagTest() {
        System.out.println(3);        
        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);
            
            PrintWriter out = null;
            try {
                out = new PrintWriter("apiTag");
                testAdTag("IFrameTag", stub, out);
                testAdTag("JavascriptTag", stub, out);
                testAdTag("NoscriptTag", stub, out);
                testAdTag("RedirectURLTag", stub, out);
                testAdTag("CombinedTag", stub, out);
                testAdTag("AOLTag", stub, out);
                testAdTag("MSNTag", stub, out);
                testAdTag("YahooTag", stub, out);
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                if (out! = null) {
                    out.close();
                }
            }                
        } catch (Exception e) {
            System.err.println("ERROR: GET_AD_TAG 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();
            }
        }       
    }

    private static void testAdTag(String tagType, ZEDOAPIStub stub, PrintWriter out) throws
                                                   InterruptedException,
                                                   com.zedo.zapi.ServiceExceptionException0 {
        try {
            GetAdTag getter = new GetAdTag();

            AdTag defaultLiteTag = new AdTag();
            defaultLiteTag.setChannelId(171655);    // default
            defaultLiteTag.setPublisherId(171656);  // default
            defaultLiteTag.setDimensionId(0);       // default
            defaultLiteTag.setLiteTag(true);
            defaultLiteTag.setTagType(tagType);
            getter.setParam0(defaultLiteTag);
            Thread.sleep(3000);
            String a = stub.getAdTag(getter).get_return();    
            System.out.println("GET_AD_TAG_COMPLETTE COMPLETE!");
            out.append(a);
            
            // Non-default
            AdTag LiteTag = new AdTag();
            LiteTag.setChannelId(311067); 
            LiteTag.setPublisherId(311745);
            LiteTag.setDimensionId(1);
            LiteTag.setLiteTag(true);
            LiteTag.setTagType(tagType);
            getter.setParam0(LiteTag);
            Thread.sleep(3000);
            a = stub.getAdTag(getter).get_return();
            System.out.println("GET_AD_TAG_COMPLETTE COMPLETE!");
            out.append(a);

            // Default
            AdTag defaultTag = new AdTag();
            defaultTag.setChannelId(171655);   // default
            defaultTag.setPublisherId(171656); // default
            defaultTag.setDimensionId(0);      // default
            defaultTag.setLiteTag(false);
            defaultTag.setTagType(tagType);
            getter.setParam0(defaultTag);
            Thread.sleep(3000);
            a = stub.getAdTag(getter).get_return();    
            System.out.println("GET_AD_TAG_COMPLETTE COMPLETE!");
            out.append(a);

            // Non-default
            AdTag tag = new AdTag();
            tag.setChannelId(311067); 
            tag.setPublisherId(311745);
            tag.setDimensionId(1);
            tag.setLiteTag(false);
            tag.setTagType(tagType);
            getter.setParam0(tag);
            Thread.sleep(3000);
            a = stub.getAdTag(getter).get_return();
            System.out.println("GET_AD_TAG_COMPLETTE COMPLETE!");
            out.append(a);
        } catch (IOException e) {
            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 
         */
        $adtag = new AdTag();
        $adtag->channelId=1041500;
        $adtag->publisherId=984538;
        $adtag->dimensionId=0;
        $adtag->enableKeywordTargeting=false;
        $adtag->keywordTargeting=null;
        $adtag->liteTag=true;
        $adtag->tagType="IFrameTag";
        
        $param = new getAdTag($adtag);
        
        /**
         *Execute API Call 
         */
        try {
                $response = $stub->getAdTag($param);
        }catch (SoapFault $ex) {
           var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "GET ADTAG FAILED\n";
            die();
        }
        
        /**
         * Response
         */
        $tmp = new getAdTagResponse($response);
        $getAdTag = $tmp->return;
        echo "GET ADTAG COMPLETE - RESPONSE : \n";
        print_r($getAdTag);

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:getAdvertiserAll" 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</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:02:10 GMT Server: Simple-Server/1.1 Content-Length: 45776 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:getAdvertiserAllResponse xmlns:ns="http://zapi.zedo.com">
<ns:return>
<actionType xmlns="http://client.api.zedo.com/xsd">-1</actionType>
<assetId xmlns="http://client.api.zedo.com/xsd">173865</assetId>
<ax21:billingContact xmlns:ax21="http://client.api.zedo.com/xsd">
<address1 xmlns="http://client.api.zedo.com/xsd">AddressDetails</address1>
<address2 xmlns="http://client.api.zedo.com/xsd">BlockName, StreetName</address2>
<city xmlns="http://client.api.zedo.com/xsd">CityName</city>
<country xmlns="http://client.api.zedo.com/xsd">USA</country>
<email xmlns="http://client.api.zedo.com/xsd">user@domain.com</email>
<fax xmlns="http://client.api.zedo.com/xsd">1010101</fax>
<firstName xmlns="http://client.api.zedo.com/xsd">FirstName</firstName>
<lastName xmlns="http://client.api.zedo.com/xsd">LastName</lastName>
<phone xmlns="http://client.api.zedo.com/xsd">1010101</phone>
<state xmlns="http://client.api.zedo.com/xsd">StateName</state>
<zipCode xmlns="http://client.api.zedo.com/xsd">12345</zipCode>
</ax21:billingContact>
<createdBy xmlns:nil="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://client.api.zedo.com/xsd" nil:nil="true" />
<createdDate xmlns:nil="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://client.api.zedo.com/xsd" nil:nil="true" />
<modifiedBy xmlns:nil="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://client.api.zedo.com/xsd" nil:nil="true" />
<modifiedDate xmlns:nil="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://client.api.zedo.com/xsd" nil:nil="true" />
<name xmlns="http://client.api.zedo.com/xsd">IDX</name>
<ax21:salesContact xmlns:ax21="http://client.api.zedo.com/xsd">
<address1 xmlns="http://client.api.zedo.com/xsd">AddressDetails</address1>
<address2 xmlns="http://client.api.zedo.com/xsd">BlockName, StreetName</address2>
<city xmlns="http://client.api.zedo.com/xsd">CityName</city>
<country xmlns="http://client.api.zedo.com/xsd">USA</country>
<email xmlns="http://client.api.zedo.com/xsd">user@domain.com</email>
<fax xmlns="http://client.api.zedo.com/xsd">1010101</fax>
<firstName xmlns="http://client.api.zedo.com/xsd">FirstName</firstName>
<lastName xmlns="http://client.api.zedo.com/xsd">LastName</lastName>
<phone xmlns="http://client.api.zedo.com/xsd">1010101</phone>
<state xmlns="http://client.api.zedo.com/xsd">StateName</state>
<zipCode xmlns="http://client.api.zedo.com/xsd">12345</zipCode>
</ax21:salesContact>
<status xmlns="http://client.api.zedo.com/xsd">A</status>
</ns:return>
</ns:getAdvertiserAllResponse>
</soapenv:Body>
</SOAP-ENV:Envelope>