Home » createChannel

createChannel

Description

 

Creates a new channel for your network.

To create Channel set the required values in the channel object. This Channel object can be set in the Channel field of the createChannel call.

Attributes

FieldTypeRequired
ChannelChannelTrue

Channel

FieldTypeDescriptionRequiredAccepted Value
idintA unique number to identify the channel. falseThis is set by default when channel is created.
namestringChannel Namefalse
statusstringDisplays whether the channel is active or inactive. trueAccepted values are "A" for active and "I" for inactive.
parentIdintParent Channel Id. Cannot be 0.true
publisherIdintPublisher Id to which the channel is linked.false
sequenceFlagintIdentifies if sequencing has been activated. falseAccepted values are 0 for OFF and 1 for ON. Default value is 0.
limitintThe maximum number of times the ad can serve on the channel.true Accepted values are through 0 to 102.
flashFlagintIdentifies if the channel is flash enabled.false Accepted values are 0 for OFF and 1 for ON. Default is 0.
codeintA unique number that identifies which network the channel belongs to.false This is set by default when a channel is created.
sslFlagintIdentifies if the channel is secure. falseAccepted values are 0 for OFF and 1 for ON.
competeDimensionintDisplays whether the channel is synchronized or not.true
channelDimensions ChannelDimensionsDenotes the dimension applicable for each channel.false
maxtileintMaximum limit that can be set for channel tiling.false
groupFlagintIdentifies if the channels are grouped in a set.false Accepted values are 0 for CHANNEL, 2 for PAGE SLOT and 1 for CHANNEL GROUP.
vastNormalFlagintSets the Vast & Normal type of channelfalse Accepted values are 0 for OFF and 1 for ON. Default is 0.
vastFlagintSets the Vast type of channelfalse Accepted values are 0 for OFF and 1 for ON. Default is 0.

Samples

Java

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

public class CreateChannelTest {

    public static void main(String[] args) {
        CreateChannelTest.createChannelTest();
    }
    
    private static void createChannelTest() {
        
        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.Channel c = new ZEDOAPIStub.Channel();

            c.setName("testDB");
//            c.setId(0);
//            c.setCode(0);
            c.setCompeteDimension(-1);
            c.setFlashFlag(0);
            c.setGroupFlag(0);
            c.setLimit(44);
            c.setMaxtile(3);
            c.setParentId(171655);
            c.setPublisherId(-3);
            c.setSslFlag(0);
            c.setStatus("A");

            ZEDOAPIStub.ChannelDimension[] cd = new ZEDOAPIStub.ChannelDimension[1];
            cd[0] = new ZEDOAPIStub.ChannelDimension();
            cd[0].setBooked(0);
            cd[0].setDeliveredToday(0);
            cd[0].setDimensionSize(44);
            cd[0].setEcpm(0);
            cd[0].setExpectedToday(0);
            cd[0].setLimit(15);
            cd[0].setMaxTile(1);
            cd[0].setStatus("A");
            c.setChannelDimensions(cd);

            ZEDOAPIStub.CreateChannel param = new ZEDOAPIStub.CreateChannel();
            param.setChannel(c);
            Thread.sleep(1000);
            ZEDOAPIStub.CreateChannelResponse ccr = stub.createChannel(param);
   
            System.out.println("CREATE_CHANNEL COMPLETE!");
            System.out.println("PLEASE: " + ccr.get_return().getId() + " " + ccr.get_return().getName());

        } catch (Exception e) {
            System.err.println("ERROR: CREATE_CHANNEL 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
         */
        $channel = new Channel();
        
        $channel->name="NewSampleChannel";
        $channel->parentId=1350040;
        $channel->publisherId=1350039;
        $channel->status="A";
        
        $channelDimensions = Array();
        $channelDimensions[0] = new ChannelDimension(); //$booked, $deliveredToday, $dimensionSize, $ecpm, $expectedToday, $limit, $maxTile, $status
        $channelDimensions[0]->booked=0;
        $channelDimensions[0]->deliveredToday=0;
        $channelDimensions[0]->dimensionSize=44;
        $channelDimensions[0]->ecpm=0;
        $channelDimensions[0]->expectedToday=0;
        $channelDimensions[0]->limit=15;
        $channelDimensions[0]->maxTile=1;
        $channelDimensions[0]->status="A";
        $channel->channelDimensions=$channelDimensions;
        
        $channel->flashFlag=0;                          //Sets whether Flash is enabled or not. Accepted values are 1(On) and 0(Off). Default is 0
        $channel->setSequenceFlag=0;                    //Identifies if sequencing has been activated. 1=On) or 0(Off). Default is 0
        
        $channel->groupFlag=0;                          //Identifies if channels are grouped in a set. Accepted values are 0(CHANNEL), 2(PAGE SLOT) or 1(CHANNEL GROUP)
        $channel->sslFlag=0;                            //Identifies if channel is secure. 1(On) or 0(Off).
        $channel->competeDimension=-1;          //Displays whether Channel is synchronised or not. Accepted values are -1(OFF) and 1(ON)
        
        $channel->limit=44;
        $channel->maxtile=3;                            //Max Limit for Channel Tiling
        
        $param = new createChannel($channel);
        
        /**
         *Execute API Call
         */
        try {
        $response = $stub->createChannel($param);
        }catch (SoapFault $ex) {
          var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "CREATE CHANNEL FAILED\n";
                die();
        }
        
        /**
         * Response
         */
        echo "CREATE CHANNEL 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:createChannel"
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:createChannel xmlns:ns5="http://zapi.zedo.com"><ns5:channel><channelDimensions xmlns="http://client.api.zedo.com/xsd"><booked>0</booked><deliveredToday>0</deliveredToday><dimensionSize>44</dimensionSize><ecpm>0.0</ecpm><expectedToday>0</expectedToday><limit>15</limit><maxTile>1</maxTile><status>A</status></channelDimensions><ns1:code xmlns:ns1="http://client.api.zedo.com/xsd">90</ns1:code><ns1:competeDimension xmlns:ns1="http://client.api.zedo.com/xsd">-1</ns1:competeDimension><ns1:flashFlag xmlns:ns1="http://client.api.zedo.com/xsd">0</ns1:flashFlag><ns1:groupFlag xmlns:ns1="http://client.api.zedo.com/xsd">0</ns1:groupFlag><ns1:limit xmlns:ns1="http://client.api.zedo.com/xsd">44</ns1:limit><ns1:maxtile xmlns:ns1="http://client.api.zedo.com/xsd">4</ns1:maxtile><ns1:name xmlns:ns1="http://client.api.zedo.com/xsd">channel123</ns1:name><ns1:parentId xmlns:ns1="http://client.api.zedo.com/xsd">993646</ns1:parentId><ns1:publisherId xmlns:ns1="http://client.api.zedo.com/xsd">-3</ns1:publisherId><ns1:sslFlag xmlns:ns1="http://client.api.zedo.com/xsd">1</ns1:sslFlag><ns1:status xmlns:ns1="http://client.api.zedo.com/xsd">A</ns1:status><ns1:vastNormalFlag xmlns:ns1="http://client.api.zedo.com/xsd">1</ns1:vastNormalFlag></ns5:channel></ns5:createChannel></soapenv:Body></soapenv:Envelope>

Response

HTTP/1.1 200 OK
Date: Wed, 20 Jan 2016 12:39:21 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8; action="urn:createChannelResponse"

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ns:createChannelResponse 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.Channel"><ax24:channelDimensions type="com.zedo.api.client.ChannelDimension"><ax24:booked>0</ax24:booked><ax24:deliveredToday>0</ax24:deliveredToday><ax24:dimensionSize>0</ax24:dimensionSize><ax24:ecpm>0.0</ax24:ecpm><ax24:expectedToday>0</ax24:expectedToday><ax24:limit>102</ax24:limit><ax24:maxTile>1</ax24:maxTile><ax24:status>A</ax24:status></ax24:channelDimensions><ax24:channelDimensions type="com.zedo.api.client.ChannelDimension"><ax24:booked>0</ax24:booked><ax24:deliveredToday>0</ax24:deliveredToday><ax24:dimensionSize>1</ax24:dimensionSize><ax24:ecpm>0.0</ax24:ecpm><ax24:expectedToday>0</ax24:expectedToday><ax24:limit>102</ax24:limit><ax24:maxTile>1</ax24:maxTile><ax24:status>A</ax24:status></ax24:channelDimensions><ax24:channelDimensions type="com.zedo.api.client.ChannelDimension"><ax24:booked>0</ax24:booked><ax24:deliveredToday>0</ax24:deliveredToday><ax24:dimensionSize>36</ax24:dimensionSize><ax24:ecpm>0.0</ax24:ecpm><ax24:expectedToday>0</ax24:expectedToday><ax24:limit>102</ax24:limit><ax24:maxTile>1</ax24:maxTile><ax24:status>A</ax24:status></ax24:channelDimensions><ax24:channelDimensions type="com.zedo.api.client.ChannelDimension"><ax24:booked>0</ax24:booked><ax24:deliveredToday>0</ax24:deliveredToday><ax24:dimensionSize>37</ax24:dimensionSize><ax24:ecpm>0.0</ax24:ecpm><ax24:expectedToday>0</ax24:expectedToday><ax24:limit>102</ax24:limit><ax24:maxTile>1</ax24:maxTile><ax24:status>A</ax24:status></ax24:channelDimensions><ax24:channelDimensions type="com.zedo.api.client.ChannelDimension"><ax24:booked>0</ax24:booked><ax24:deliveredToday>0</ax24:deliveredToday><ax24:dimensionSize>38</ax24:dimensionSize><ax24:ecpm>0.0</ax24:ecpm><ax24:expectedToday>0</ax24:expectedToday><ax24:limit>102</ax24:limit><ax24:maxTile>1</ax24:maxTile><ax24:status>A</ax24:status></ax24:channelDimensions><ax24:channelDimensions type="com.zedo.api.client.ChannelDimension"><ax24:booked>0</ax24:booked><ax24:deliveredToday>0</ax24:deliveredToday><ax24:dimensionSize>39</ax24:dimensionSize><ax24:ecpm>0.0</ax24:ecpm><ax24:expectedToday>0</ax24:expectedToday><ax24:limit>102</ax24:limit><ax24:maxTile>1</ax24:maxTile><ax24:status>A</ax24:status></ax24:channelDimensions><ax24:channelDimensions type="com.zedo.api.client.ChannelDimension"><ax24:booked>0</ax24:booked><ax24:deliveredToday>0</ax24:deliveredToday><ax24:dimensionSize>40</ax24:dimensionSize><ax24:ecpm>0.0</ax24:ecpm><ax24:expectedToday>0</ax24:expectedToday><ax24:limit>102</ax24:limit><ax24:maxTile>1</ax24:maxTile><ax24:status>A</ax24:status></ax24:channelDimensions><ax24:channelDimensions type="com.zedo.api.client.ChannelDimension"><ax24:booked>0</ax24:booked><ax24:deliveredToday>0</ax24:deliveredToday><ax24:dimensionSize>41</ax24:dimensionSize><ax24:ecpm>0.0</ax24:ecpm><ax24:expectedToday>0</ax24:expectedToday><ax24:limit>102</ax24:limit><ax24:maxTile>1</ax24:maxTile><ax24:status>A</ax24:status></ax24:channelDimensions><ax24:channelDimensions type="com.zedo.api.client.ChannelDimension"><ax24:booked>0</ax24:booked><ax24:deliveredToday>0</ax24:deliveredToday><ax24:dimensionSize>42</ax24:dimensionSize><ax24:ecpm>0.0</ax24:ecpm><ax24:expectedToday>0</ax24:expectedToday><ax24:limit>102</ax24:limit><ax24:maxTile>1</ax24:maxTile><ax24:status>A</ax24:status></ax24:channelDimensions><ax24:channelDimensions type="com.zedo.api.client.ChannelDimension"><ax24:booked>0</ax24:booked><ax24:deliveredToday>0</ax24:deliveredToday><ax24:dimensionSize>67</ax24:dimensionSize><ax24:ecpm>0.0</ax24:ecpm><ax24:expectedToday>0</ax24:expectedToday><ax24:limit>102</ax24:limit><ax24:maxTile>1</ax24:maxTile><ax24:status>A</ax24:status></ax24:channelDimensions><ax24:channelDimensions type="com.zedo.api.client.ChannelDimension"><ax24:booked>0</ax24:booked><ax24:deliveredToday>0</ax24:deliveredToday><ax24:dimensionSize>68</ax24:dimensionSize><ax24:ecpm>0.0</ax24:ecpm><ax24:expectedToday>0</ax24:expectedToday><ax24:limit>102</ax24:limit><ax24:maxTile>1</ax24:maxTile><ax24:status>A</ax24:status></ax24:channelDimensions><ax24:channelDimensions type="com.zedo.api.client.ChannelDimension"><ax24:booked>0</ax24:booked><ax24:deliveredToday>0</ax24:deliveredToday><ax24:dimensionSize>69</ax24:dimensionSize><ax24:ecpm>0.0</ax24:ecpm><ax24:expectedToday>0</ax24:expectedToday><ax24:limit>102</ax24:limit><ax24:maxTile>1</ax24:maxTile><ax24:status>A</ax24:status></ax24:channelDimensions><ax24:channelDimensions type="com.zedo.api.client.ChannelDimension"><ax24:booked>0</ax24:booked><ax24:deliveredToday>0</ax24:deliveredToday><ax24:dimensionSize>70</ax24:dimensionSize><ax24:ecpm>0.0</ax24:ecpm><ax24:expectedToday>0</ax24:expectedToday><ax24:limit>102</ax24:limit><ax24:maxTile>1</ax24:maxTile><ax24:status>A</ax24:status></ax24:channelDimensions><ax24:code>7657</ax24:code><ax24:competeDimension>-1</ax24:competeDimension><ax24:flashFlag>0</ax24:flashFlag><ax24:groupFlag>0</ax24:groupFlag><ax24:id>1173690</ax24:id><ax24:limit>102</ax24:limit><ax24:maxtile>1</ax24:maxtile><ax24:name>channel123</ax24:name><ax24:parentId>993646</ax24:parentId><ax24:publisherId>-3</ax24:publisherId><ax24:sequenceFlag>0</ax24:sequenceFlag><ax24:sslFlag>1</ax24:sslFlag><ax24:status>A</ax24:status><ax24:vastFlag>0</ax24:vastFlag><ax24:vastNormalFlag>1</ax24:vastNormalFlag></ns:return></ns:createChannelResponse></soapenv:Body></soapenv:Envelope>