Home » getCreative

getCreative

Description

Gets the creative with given id.

This function returns a Creative object which contains basic details about the creative. If more advanced data is required, you can use the getCreativeDetails function.

Attributes

FieldTypeDescriptionRequired
IdintCreative IDTrue

Samples

Java

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

public class GetCreativeTest {

    public static void main(String[] args) {
        GetCreativeTest.getCreativeTest();
    }

    private static void getCreativeTest() {
        
        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);
            
            GetCreative gcc = new GetCreative();
            gcc.setId(418188);
            Thread.sleep(5000);
            Creative cc = stub.getCreative(gcc).get_return();
    
            System.out.println("GET_CREATIVE COMPLETE!");
            System.out.println("PLEASE: " + cc.getName() + " " + cc.getId());

        } catch (Exception e) {
            System.err.println("ERROR: GET_CREATIVE 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@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 
         */
        $creative_id = 1095044;
        $param = new getCreative($creative_id);
        
        /**
         *Execute API Call 
         */
        try {
                $response = $stub->getCreative($param);
        }catch (SoapFault $ex) {
             var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "GET CREATIVE FAILED\n";
            die();
        }
        
        /**
         * Response
         */
        $tmp = new getCreativeResponse($response);
        $creative = $tmp->return;
        echo "GET CREATIVE COMPLETE - RESPONSE : \n";
        print_r($creative);

SOAP

Request

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


Response

HTTP/1.1 200 OK
Date: Thu, 21 Jan 2016 05:38:43 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8; action="urn:getCreativeResponse"

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:getCreativeResponse 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.Creative">
<ax24:actionsAllocated>0</ax24:actionsAllocated>
<ax24:actionsDelivered>0</ax24:actionsDelivered>
<ax24:actionsDelta>0</ax24:actionsDelta>
<ax24:allocateByDay>0</ax24:allocateByDay>
<ax24:altText>Test_1</ax24:altText>
<ax24:attributes>2305</ax24:attributes>
<ax24:booked>0</ax24:booked>
<ax24:campaignId>1171329</ax24:campaignId>
<ax24:clickThroughURL>
</ax24:clickThroughURL>
<ax24:clicksAllocated>0</ax24:clicksAllocated>
<ax24:clicksDelivered>0</ax24:clicksDelivered>
<ax24:clicksDelta>0</ax24:clicksDelta>
<ax24:dimensionId>9</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>858758</ax24:id>
<ax24:impressionsAllocated>0</ax24:impressionsAllocated>
<ax24:impressionsDelivered>0</ax24:impressionsDelivered>
<ax24:impressionsDelta>0</ax24:impressionsDelta>
<ax24:name>Api_2_test</ax24:name>
<ax24:piactionsDelivered>0</ax24:piactionsDelivered>
<ax24:piactionsDelta>0</ax24:piactionsDelta>
<ax24:profileType>0</ax24:profileType>
<ax24:status>APP</ax24:status>
<ax24:timezoneId>1</ax24:timezoneId>
<ax24:type>HTML</ax24:type>
<ax24:uploadDelta>0</ax24:uploadDelta>
<ax24:uploadTick>0</ax24:uploadTick>
<ax24:version>2</ax24:version>
<ax24:weight>1</ax24:weight>
</ns:return>
</ns:getCreativeResponse>
</soapenv:Body>
</soapenv:Envelope>