Home » getPayoutGroupAll

getPayoutGroupAll

Description

Gets the payout list for the given networks

Attributes

Function doesn’t accept attributes

Samples

Java

import com.zedo.zapi.*;
import com.zedo.zapi.ZEDOAPIStub.*;
import java.lang.reflect.Method;
import javax.xml.namespace.QName;
import org.apache.axis2.AxisFault;

public class GetPayoutGroupAllTest {

    public static void main(String[] args) {
        GetPayoutGroupAllTest.getPayoutGroupAllTest();
    }

    private static void getPayoutGroupAllTest() {
        
        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"),  "809");
           
            Thread.sleep(10000);
            PayoutGroup[] payoutGroupAll = stub.getPayoutGroupAll().get_return();
     
            System.out.println("GET_PAYOUT_GROUP_ALL COMPLETE!");            
            for (PayoutGroup payoutGroup : payoutGroupAll) {              
                System.out.println("\n----------------------------------------\n");
                printObject(payoutGroup);               
            }

        } catch (Exception e) {
            System.err.println("ERROR: GET_PAYOUT_GROUP_ALL 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();
            }
        }
    }
    
    public static void printObject(Object obj) {
        System.out.print(printObject(obj, 1));
    }

    protected static String getOffset(int nOffset) {
        String res = "";
        for (int i = 0; i < nOffset; i++) {
            res += "  ";
        }
        return res;
    }

    protected static String printObject(Object obj, int offset) {

        if (obj == null) {
            return "";
        }

        String res = "";

        if (obj.getClass().isArray()) {
            try {
                int i = 0;
                for (Object _obj : (Object[]) obj) {
                    res += getOffset(offset + 1) + "[" + i++ + "]\n" + printObject(_obj, offset + 1);
                }
            } catch (ClassCastException e) {
            }
        } else {
            Class cn = obj.getClass();
            res += getOffset(offset) + cn.getSimpleName() + (cn.getPackage().getName().equals("java.lang") ? (" (" + obj + ")"):  "") + "\n";

            for (Method m : cn.getDeclaredMethods()) {
                String methodName = m.getName();
                if (methodName.startsWith("get")) {
                    Object objkt = null;
                    try {
                        objkt = m.invoke(obj);
                    } catch (Exception e) {
//                        System.err.println("Exception: " + e.getMessage());
//                        e.printStackTrace();
                        continue;
                    }
                    if (objkt != null) {
                        if (objkt.getClass().isArray() || objkt.getClass().getPackage().getName().equals("com.zedo.api.service")) {
                            res += getOffset(offset + 1) + methodName.substring(3) + ": \n";
                            res += printObject(objkt, offset + 2);
                        } else {
                            res += getOffset(offset + 1) + methodName.substring(3) + ": ";
                            if (objkt.getClass().getPackage().getName().equals("java.lang")) {
                                res += objkt + "\n";
                            } else {
                                res += "\n" + printObject(objkt, offset + 2);
                            }
                        }
                    } else {
                        res += getOffset(offset + 1) + methodName.substring(3) + ": null\n";
                    }
                }
            }
        }
        return res;
    }
}

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 
         */
        try {
                $response = $stub->getPayoutGroupAll();
        }catch (SoapFault $ex) {
            var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "GET PAYOUTGROUP ALL FAILED\n";
            die();
        }
        
        /**
         * Response
         */
        $tmp = new getPayoutGroupAllResponse($response);
        $payoutGroupAll = $tmp->return;
        echo "GET PAYOUTGROUP ALL COMPLETE - RESPONSE : \n";
        print_r($payoutGroupAll);

SOAP

Request

POST /axis2/services/ZEDOAPI?wsdl HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:getPayoutGroupAll"
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 />
</soapenv:Envelope>

Response

HTTP/1.1 200 OK
Date: Wed, 20 Jan 2016 07:27:25 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8; action="urn:getPayoutGroupAllResponse"
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:getPayoutGroupAllResponse 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.PayoutGroup">
<ax24:payoutGroupKey type="com.zedo.api.client.PayoutGroupKey">
<ax24:advertiserId>389148</ax24:advertiserId>
<ax24:campaignId>389149</ax24:campaignId>
<ax24:channelId>171655</ax24:channelId>
<ax24:dimensionId>-1</ax24:dimensionId>
<ax24:publisherId>-1</ax24:publisherId>
</ax24:payoutGroupKey>
<ax24:payoutSchemeType>advanced</ax24:payoutSchemeType>
<ax24:payouts type="com.zedo.api.client.Payout">
<ax24:endDate>2008-02-10 00:00:00</ax24:endDate>
<ax24:payoutGeos type="com.zedo.api.client.PayoutGeo">
<ax24:cpc>1.0</ax24:cpc>
<ax24:cpm>2.0</ax24:cpm>
<ax24:duration>-1</ax24:duration>
<ax24:geoId>1</ax24:geoId>
<ax24:revShare>0.0</ax24:revShare>
<ax24:status>A</ax24:status>
</ax24:payoutGeos>
<ax24:startDate>2008-02-01 00:00:00</ax24:startDate>
<ax24:status>A</ax24:status>
</ax24:payouts>
<ax24:payouts type="com.zedo.api.client.Payout">
<ax24:endDate>2008-03-10 00:00:00</ax24:endDate>
<ax24:payoutGeos type="com.zedo.api.client.PayoutGeo">
<ax24:cpc>1.0</ax24:cpc>
<ax24:cpm>2.0</ax24:cpm>
<ax24:duration>-1</ax24:duration>
<ax24:geoId>1</ax24:geoId>
<ax24:revShare>0.0</ax24:revShare>
<ax24:status>A</ax24:status>
</ax24:payoutGeos>
<ax24:startDate>2008-03-01 00:00:00</ax24:startDate>
<ax24:status>A</ax24:status>
</ax24:payouts>
<ax24:payouts type="com.zedo.api.client.Payout">
<ax24:endDate>2008-04-10 00:00:00</ax24:endDate>
<ax24:payoutGeos type="com.zedo.api.client.PayoutGeo">
<ax24:cpc>1.0</ax24:cpc>
<ax24:cpm>2.0</ax24:cpm>
<ax24:duration>-1</ax24:duration>
<ax24:geoId>1</ax24:geoId>
<ax24:revShare>0.0</ax24:revShare>
<ax24:status>A</ax24:status>
</ax24:payoutGeos>
<ax24:startDate>2008-04-01 00:00:00</ax24:startDate>
<ax24:status>A</ax24:status>
</ax24:payouts>
<ax24:status>A</ax24:status>
</ns:return>
<ns:return type="com.zedo.api.client.PayoutGroup">
<ax24:payoutGroupKey type="com.zedo.api.client.PayoutGroupKey">
<ax24:advertiserId>297768</ax24:advertiserId>
<ax24:campaignId>-1</ax24:campaignId>
<ax24:channelId>171655</ax24:channelId>
<ax24:dimensionId>-1</ax24:dimensionId>
<ax24:publisherId>-1</ax24:publisherId>
</ax24:payoutGroupKey>
<ax24:payoutSchemeType>advanced</ax24:payoutSchemeType>
<ax24:payouts type="com.zedo.api.client.Payout">
<ax24:endDate>2008-02-01 00:00:00</ax24:endDate>
<ax24:payoutGeos type="com.zedo.api.client.PayoutGeo">
<ax24:cpc>1.0</ax24:cpc>
<ax24:cpm>1.0</ax24:cpm>
<ax24:duration>-1</ax24:duration>
<ax24:geoId>1</ax24:geoId>
<ax24:revShare>0.0</ax24:revShare>
<ax24:status>A</ax24:status>
</ax24:payoutGeos>
<ax24:startDate>2008-01-01 00:00:00</ax24:startDate>
<ax24:status>A</ax24:status>
</ax24:payouts>
<ax24:status>A</ax24:status>
</ns:return>
</ns:getPayoutGroupAllResponse>
</soapenv:Body>
</soapenv:Envelope>