Home » updateChannel

updateChannel

Description

Updates the channel with the given asset ID

Attributes

FieldTypeRequired
ChannelChannelTrue

Channel

NameTypeDescriptionRequiredAccepted Value
idintA unique number to identify the channel.false This is set by default when channel is created.
namestringChannel Namefalse
statusstringDisplays whether the channel is active or inactive. falseAccepted values are "A" for active and "I" for inactive.
parentIdintParent Channel Id. Cannot be 0.false
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. falseAccepted values are through 0 to 102.
flashFlagintIdentifies if the channel is flash enabled. falseAccepted values are 0 for OFF and 1 for ON. Default is 0.
codeintA unique number that identifies which network the channel belongs to. falseThis 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.false
channelDimensionsChannelDimensionDenotes 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 channelfalseAccepted 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 UpdateChannelTest {

    public static void main(String[] args) {
        UpdateChannelTest.updateChannelTest();
    }
    
    private static void updateChannelTest() {
        
        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.GetChannel gc = new ZEDOAPIStub.GetChannel();
            gc.setId(463461);
            Thread.sleep(1000);
            ZEDOAPIStub.GetChannelResponse gcr = stub.getChannel(gc);
            ZEDOAPIStub.Channel c = gcr.get_return();

//            c.setName("");
            c.setStatus("I"); 
        
            ZEDOAPIStub.UpdateChannel uc = new ZEDOAPIStub.UpdateChannel();
            uc.setChannel(c);
            Thread.sleep(1000);
            stub.updateChannel(uc);

            System.out.println("UPDATE_CHANNEL COMPLETE!");
            System.out.println("PLEASE: " + uc.getChannel().getId() + " " + uc.getChannel().getName());

        } catch (Exception e) {
            System.err.println("ERROR: UPDATE_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_id = 1350192;
        $param = new getChannel($channel_id);
        
        /**
         *Execute API Call 
         */
        
        try {
        $response = $stub->getChannel($param);
        }catch (SoapFault $ex) {
           var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "GET ADVERTISER FAILED\n";
                die();
        }
        
        /**
         * Response
         */
        $tmp = new getChannelResponse($response);
        $tmp = $tmp->return;
        $channel = $tmp->return;
        /**
         * Edit Campaign
         */
        $channelDimensions = Array();
        $channelDimensions[0] = new ChannelDimension(0, 0, 44, 0, 0, 8, 1, "A"); //$booked, $deliveredToday, $dimensionSize, $ecpm, $expectedToday, $limit, $maxTile, $status
        $channelDimensions[1] = new ChannelDimension(0, 0, 19, 0, 0, 5, 1, "A");
        $channelDimensions[1] = new ChannelDimension(0, 0, 20, 0, 0, 6, 1, "A");
        $channel->channelDimensions=$channelDimensions;
        
        /**
         * Update Campaign
         */
        print_r($channel);
        $updateChannel = new updateChannel($channel);
        try {
                $response = $stub->updateChannel($updateChannel);
        }catch (SoapFault $ex) {
           var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "UPDATE CHANNEL FAILED\n";
                die();
        }


SOAP

Request


POST /axis2/services/ZEDOAPI?wsdl HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:updateChannel"
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">pasword</zedoapi:password>
<zedoapi:network xmlns:zedoapi="http://api.zedo.com">525</zedoapi:network>
</soapenv:Header>
<soapenv:Body>
<ns5:updateChannel xmlns:ns5="http://zapi.zedo.com">
<ns5:channel>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>55</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>56</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>57</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>58</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>59</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>60</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>61</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>62</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>63</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>64</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>65</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>66</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>94</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<channelDimensions xmlns="http://client.api.zedo.com/xsd">
<booked>0</booked>
<deliveredToday>0</deliveredToday>
<dimensionSize>95</dimensionSize>
<ecpm>0.0</ecpm>
<expectedToday>0</expectedToday>
<limit>102</limit>
<maxTile>1</maxTile>
<status>A</status>
</channelDimensions>
<ns1:code xmlns:ns1="http://client.api.zedo.com/xsd">7657</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:id xmlns:ns1="http://client.api.zedo.com/xsd">1173690</ns1:id>
<ns1:limit xmlns:ns1="http://client.api.zedo.com/xsd">102</ns1:limit>
<ns1:maxtile xmlns:ns1="http://client.api.zedo.com/xsd">1</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:sequenceFlag xmlns:ns1="http://client.api.zedo.com/xsd">0</ns1:sequenceFlag>
<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:vastFlag xmlns:ns1="http://client.api.zedo.com/xsd">0</ns1:vastFlag>
<ns1:vastNormalFlag xmlns:ns1="http://client.api.zedo.com/xsd">1</ns1:vastNormalFlag>
</ns5:channel>
</ns5:updateChannel>
</soapenv:Body>
</soapenv:Envelope>

Response

HTTP/1.1 200 OK
Date: Thu, 21 Jan 2016 09:12:10 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8; action="urn:updateChannelResponse"
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:updateChannelResponse xmlns:ns="http://zapi.zedo.com">
<ns:return>0</ns:return>
</ns:updateChannelResponse>
</soapenv:Body>
</soapenv:Envelope>