Home » getChannelSetByStatus

getChannelSetByStatus

Description

Gets the active and inactive channel sets for the given network based on the status.

If no status is specified, both active and inactive channel sets are returned.

Attributes

FieldTypeDescriptionRequiredAccepted Value
channelSetStatusStringStatus of the channel sets to be retrievedFalseAccepted values are: A,I

Samples

Java

import com.zedo.zapi.*;
import com.zedo.zapi.ZEDOAPIStub.ChannelId;
import com.zedo.zapi.ZEDOAPIStub.*;
import com.zedo.zapi.zclients.config.Config;

import javax.xml.namespace.QName;

import org.apache.axis2.AxisFault;

public class GetChannelSetByStatusTest {

    public static void main(String[] args) {
        GetChannelSetByStatusTest.getChannelSetByStatusTest();
    }

    private static void getChannelSetByStatusTest() {
        
        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);
            Thread.sleep(5000);

            GetChannelSetByStatus c= new GetChannelSetByStatus();
            c.setChannelSetStatus("I");
            ChannelSet[] c1= stub.getChannelSetByStatus(c).get_return();
     
            
            System.out.println("GET_CHANNEL_SET_BY_STATUS COMPLETE!");
            for (ChannelSet channelSet : c1) {
                
                if(null != channelSet.getChannelIds())
                for(ChannelId channel: channelSet.getChannelIds()) {
                    System.out.println("channelId: "+channel.getId() + " status :" + channel.getStatus());
                }
                System.out.println(channelSet.getId() + " " + channelSet.getName()+" "+channelSet.getType() );
            }
            
            

        } catch (Exception e) {
            System.err.println("ERROR: GET_CHANNEL_SET_BY_STATUS 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
         */

        /**
         *Execute API Call
         */
        $channelset_status = 'I';
        $param = new getChannelSetByStatus($channelset_status);

        try {
                $response = $stub->getChannelSetByStatus($param);
        }catch (SoapFault $ex) {
            var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "GET CHANNELSET BY STATUS FAILED\n";
            die();
        }

        /**
         * Response
         */
        $tmp = new getChannelSetByStatusResponse($response);
        $channelSetAll = $tmp->return;
        echo "GET CHANNELSET BY STATUS COMPLETE - RESPONSE : \n";
        print_r($channelSetAll);

SOAP

Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:zapi="http://zapi.zedo.com">

 <soapenv:Header>

      <zedoapi:user xmlns:zedoapi="http://api.zedo.com">example@zedo.com</zedoapi:user>

      <zedoapi:password xmlns:zedoapi="http://api.zedo.com">passwordKey</zedoapi:password>

      <zedoapi:network xmlns:zedoapi="http://api.zedo.com">525</zedoapi:network>

   </soapenv:Header>

   <soapenv:Body>

      <zapi:getChannelSetByStatus>

         <!--Optional:-->

         <zapi:channelSetStatus>I</zapi:channelSetStatus>

      </zapi:getChannelSetByStatus>

   </soapenv:Body>

</soapenv:Envelope>


Response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
 <soapenv:Body>
 <ns:getChannelSetByStatusResponse xmlns:ns="http://zapi.zedo.com" 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">
 <ns:return type="com.zedo.api.client.ChannelSet">
 <ax24:channelIds type="com.zedo.api.client.ChannelId">
 <ax24:id>400466</ax24:id>
 <ax24:status>A</ax24:status>
 </ax24:channelIds>
 <ax24:channelIds type="com.zedo.api.client.ChannelId">
 <ax24:id>445225</ax24:id>
 <ax24:status>A</ax24:status>
 </ax24:channelIds>
 <ax24:channelIds type="com.zedo.api.client.ChannelId">
 <ax24:id>445532</ax24:id>
 <ax24:status>A</ax24:status>
 </ax24:channelIds>
 <ax24:channelIds type="com.zedo.api.client.ChannelId">
 <ax24:id>445542</ax24:id>
 <ax24:status>A</ax24:status>
 </ax24:channelIds>
 <ax24:id>4787</ax24:id>
 <ax24:name>CS-123</ax24:name>
 <ax24:status>I</ax24:status>
 <ax24:type>0</ax24:type>
 </ns:return>
 <ns:return type="com.zedo.api.client.ChannelSet">
 <ax24:id>4789</ax24:id>
 <ax24:name>ES-puburl4</ax24:name>
 <ax24:status>I</ax24:status>
 <ax24:type>2</ax24:type>
 </ns:return>
 </ns:getChannelSetByStatusResponse>
 </soapenv:Body>
</soapenv:Envelope>