Home » updateChannelSet

updateChannelSet

Description

Updates the channel set with the given asset ID

Attributes

FieldTypeRequired
ChannelSetChannelSetTrue

ChannelSet

NameTypeDescriptionRequiredAccepted Value
idintChannel Id.false
namestringChannel Set Name.false
statusstringDisplays whether the channel set is active or inactive. falseAccepted values are "A" for active and "I" for inactive.
channleIdsChannelIdA unique number to identify the channels within the channel set.

Samples

Java

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

public class UpdateChannelSetTest {

    public static void main(String[] args) {
        UpdateChannelSetTest.updateChannelSetTest();
    }
    
    private static void updateChannelSetTest() {
        
        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.GetChannelSet gcs = new ZEDOAPIStub.GetChannelSet();
            gcs.setId(1160);
            Thread.sleep(1000);
            ZEDOAPIStub.GetChannelSetResponse gcsr = stub.getChannelSet(gcs);
            ZEDOAPIStub.ChannelSet cs = gcsr.get_return();
            
//            cs.setId(0);
//            cs.setName("");
            cs.setStatus("A");
            
//            ZEDOAPIStub.ChannelId[] ci = new ZEDOAPIStub.ChannelId[5];
//            ci[0] = new ZEDOAPIStub.ChannelId();
//            ci[0].setId(191045);
//            ci[0].setStatus("I");
//            ci[1] = new ZEDOAPIStub.ChannelId();
//            ci[1].setId(377371);
//            ci[1].setStatus("I");
//            ci[2] = new ZEDOAPIStub.ChannelId();
//            ci[2].setId(310636);
//            ci[2].setStatus("I");
//            ci[3] = new ZEDOAPIStub.ChannelId();
//            ci[3].setId(413866);
//            ci[3].setStatus("I");
//            ci[4] = new ZEDOAPIStub.ChannelId();
//            ci[4].setId(413308);
//            ci[4].setStatus("I");
//            cs.setChannelIds(ci);
      
            ZEDOAPIStub.UpdateChannelSet ucs = new ZEDOAPIStub.UpdateChannelSet();
            ucs.setChannelSet(cs);
            Thread.sleep(1000);
            stub.updateChannelSet(ucs);
   
            System.out.println("UPDATE_CHANNEL_SET COMPLETE!");
            System.out.println("PLEASE: " + ucs.getChannelSet().getId() + " " + ucs.getChannelSet().getName());

        } catch (Exception e) {
            System.err.println("ERROR: UPDATE_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_id = 6741;
        $param = new getChannelSet($channelset_id);
        
        /**
         *Execute API Call 
         */
        
        try {
        $response = $stub->getChannelSet($param);
        }catch (SoapFault $ex) {
            var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "GET CHANNELSET FAILED\n";
                die();
        }
        
        /**
         * Response
         */
        $tmp = new getChannelSetResponse($response);
        $tmp = $tmp->return;
        $channelset = $tmp->return;
        
        /**
         * Edit ChannelSet
         */
        $channelIds = Array();
        $channelIds[0] = new ChannelId(1350181, "A");
        $channelIds[1] = new ChannelId(1326868, "A");
        
        $channelset->channelIds=$channelIds;
        
        /**
         * Update ChannelSet
         */
        print_r($channelset);
        $updateChannelSet = new updateChannelSet($channelset);
        try {
                $response = $stub->updateChannelSet($updateChannelSet);
        }catch (SoapFault $ex) {
           var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "UPDATE CHANNELSET FAILED\n";
                die();
        }


SOAP

Request

POST /axis2/services/ZEDOAPI?wsdl HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:updateChannelSet"
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:updateChannelSet xmlns:ns5="http://zapi.zedo.com">
<ns5:channelSet>
<channelIds xmlns="http://client.api.zedo.com/xsd">
<id>1173690</id>
<status>A</status>
</channelIds>
<ns1:id xmlns:ns1="http://client.api.zedo.com/xsd">6578</ns1:id>
<ns1:name xmlns:ns1="http://client.api.zedo.com/xsd">channelsettest</ns1:name>
<ns1:status xmlns:ns1="http://client.api.zedo.com/xsd">A</ns1:status>
<ns1:type xmlns:ns1="http://client.api.zedo.com/xsd">0</ns1:type>
</ns5:channelSet>
</ns5:updateChannelSet>
</soapenv:Body>
</soapenv:Envelope>

Response

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