Home » createChannelSet

createChannelSet

Description

Creates a set by grouping channels based on the customer preference.

To create channelSet the required values in the channelSet object. This channelSet object can be set in the ChannelSet field of the createChannelSet call.

Attributes

 

FieldTypeRequired
ChannelSetChannelSetTrue

ChannelSet

FieldTypeDescriptionRequiredAccepted Value
idintChannel Set Id.false
namestringChannel Set Name.true
statusstringDisplays whether the channel set is active or inactive. trueAccepted values are "A" for active and "I" for inactive.
channelIdsChannelIdsA unique number to identify the channels within the channel set.true
typeintType of channel set to be createdtrueAccepted values are: 0 for INCLUSIVE, 1 for FLASH, 2 for EXCLUSION, 3 for FLASH_EXCLUSION, 4 for VAST, 5 for VAST_EXCLUSION

Samples

Java

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

public class CreateChannelSetTest {

    public static void main(String[] args) {
        CreateChannelSetTest.createChannelSetTest();
    }
    
    private static void createChannelSetTest() {
        
        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.ChannelSet cs = new ZEDOAPIStub.ChannelSet();
            

            cs.setName("test9");
            cs.setStatus("A");
            cs.setType(0);
             
            ZEDOAPIStub.ChannelId[] ci = new ZEDOAPIStub.ChannelId[4];
            ci[0] = new ZEDOAPIStub.ChannelId();
            ci[0].setId(191045);
            ci[0].setStatus("A");
            ci[1] = new ZEDOAPIStub.ChannelId();
            ci[1].setId(377371);
            ci[1].setStatus("A");
            ci[2] = new ZEDOAPIStub.ChannelId();
            ci[2].setId(310636);
            ci[2].setStatus("A");
            ci[3] = new ZEDOAPIStub.ChannelId();
            ci[3].setId(413866);
            ci[3].setStatus("A");
            cs.setChannelIds(ci);
                      
            ZEDOAPIStub.CreateChannelSet ccs = new ZEDOAPIStub.CreateChannelSet();
            ccs.setChannelSet(cs);
            Thread.sleep(1000);
            ZEDOAPIStub.CreateChannelSetResponse ccsr = stub.createChannelSet(ccs);
   
            System.out.println("CREATE_CHANNEL_SET COMPLETE!");
            System.out.println("PLEASE: " + ccsr.get_return().getId() + " " + ccsr.get_return().getName());

        } catch (Exception e) {
            System.err.println("ERROR: CREATE_CHANNEL_SET 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 
         */
        $channelset = new ChannelSet();
        
        $channelset->name="NewSampleChannelSet1";
        $channelset->status="A";
        $channelset->type=0;
        $channelIds = Array();
        $channelIds[0] = new ChannelId(1350192, "A");
        $channelIds[1] = new ChannelId(1350193, "A");
        $channelset->channelIds=$channelIds;
        
        $param = new createChannelSet($channelset);
        
        /**
         *Execute API Call 
         */
                try {
                $response = $stub->createChannelSet($param);
                }catch (SoapFault $ex) {
                var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                        echo "CREATE CHANNELSET FAILED\n";
            die();
        }
        
        /**
         * Response
         */
                echo "CREATE CHANNELSET COMPLETE\n\n";
        echo "\nReponse:\n";
        echo $stub->__getLastResponse();

SOAP

Request

POST /axis2/services/ZEDOAPI?wsdl HTTP/1.0 Host: localhost:8080 User-Agent: NuSOAP/0.7.2 (1.1.1.1) Content-Type: text/xml; charset=ISO-8859-1 SOAPAction: "urn:createChannelSet" Content-Length:713<? 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>
<user>eric@zedo.com</user>
<password xmlns="http://zapi.zedo.com">twinkle</password>
<network>525</network>
<callinfo>zapiCall</callinfo>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<createChannelSet xmlns="http://zapi.zedo.com/xsd">
<param0>
<channelIds>
<assetId>191045</assetId>
<status>A</status>
</channelIds>
<id>998</id>
<name>NewChannelSet</name>
<status>A</status>
</param0>
</createChannelSet>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response

HTTP/1.0 200 OK Date: Tue, 20 May 2008 10:59:04 GMT Server: Simple-Server/1.1 Content-Type: text/xml; charset=ISO-8859-1 Connection: Close<? xml version='1.0' encoding='ISO-8859-1'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:createChannelSetResponse xmlns:ns="http://zapi.zedo.com">
<ns:return xmlns:ax29="http://util.zedo.com/xsd" xmlns:ax28="http://base.zedo.com/xsd" xmlns:ax212="http://soap.reportengine.zedo.com/xsd" xmlns:ax211="http://client.api.zedo.com/xsd"type="com.zedo.api.client.ChannelSet">
<ax211:channelIds type="com.zedo.api.client.ChannelId">
<ax211:assetId>191045</ax211:assetId>
<ax211:status>A</ax211:status>
</ax211:channelIds>
<ax211:id>1418</ax211:id>
<ax211:name>NewChannelSet</ax211:name>
<ax211:status>A</ax211:status>
</ns:return>
</ns:createChannelSetResponse>
</soapenv:Body>
</soapenv:Envelope>