Home » updateAdvertiser

updateAdvertiser

Description

Updates the advertiser with the given asset ID

Attributes

FieldTypeRequired
AdvAdvertiserTrue

Advertiser

FieldTypeDescriptionRequiredAccepted Value
idintA unique number to identify the advertiser.true This is set by default when advertiser is created.
namestringAdvertiser Namefalse
statusstringDisplays whether advertiser is Active or Inactive. falseAccepted values are 'A' for active and 'I' for inactive.
salesContactContactInformation of a sales contact person.false
billingContactContactInformation of a person to contact for billing purposes.false
createdByintShows who created the advertiser. This is set by default when advertiser is created.false
createdDatestringDate when the advertiser was created. falseThis is set by default when advertiser is created.
modifiedByintShows who modified advertiser details.false This is set by default when advertiser is modified.
modifiedDatestringDate when the advertiser was last modified.false This is set by default when advertiser is modified.
actionTypeintActions can be defined at advertiser or campaign level. falseAccepted values are 0 (Campaign level actions) and 1 (Advertiser level actions)
actionsAction[ ]Number of actions delivered by the advertiser. Actions are mandatory if actionType is set to 1.false
tagsTags[ ]Sets the tags for the advertiserfalseMaximum no. of tags allowed are 5.
deleteTagsTags[ ]Deletes the tags for the advertiserfalseMaximum no. of tags allowed are 5.

Samples

Java

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

public class UpdateAdvertiserTest {

    public static void main(String[] args) {
        UpdateAdvertiserTest.updateAdvertiserTest();
    }

    private static void updateAdvertiserTest() {
        
        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.GetAdvertiser req = new ZEDOAPIStub.GetAdvertiser();

            req.setId(463451);
            Thread.sleep(1000);
            ZEDOAPIStub.GetAdvertiserResponse res = stub.getAdvertiser(req);
            ZEDOAPIStub.Advertiser a = res.get_return();

            a.setName("noname");
            a.setActionType(0);                            // ignore
            a.setStatus("A");

            //a.setCreatedBy("testZedo@zedo.com");         // ignore 
            //a.setCreatedDate("2007-12-04 00:00:00");     // ignore           
            //a.setId(123);                                // ignore
            //a.setModifiedBy("testZedo@zedo.com");        // ignore
            //a.setModifiedDate("");                       // ignore

            a.setMaxLifeTime(15);
            ZEDOAPIStub.Action[] action = new ZEDOAPIStub.Action[1];
            action[0] = new ZEDOAPIStub.Action();
            action[0].setItemNumber(1);
            action[0].setName("true");
            action[0].setRate(2.34345e+32);
            action[0].setStatus("A");
            action[0].setUrl("http://www.myTest.com");
            a.setActions(action);

            ZEDOAPIStub.Contact c1 = new ZEDOAPIStub.Contact();
            c1.setAddress1("");
            c1.setAddress2("");
            c1.setCity("");
            c1.setCountry("");
            c1.setEmail("");
            c1.setFax("");
            c1.setFirstName("fyty");
            c1.setLastName("hhhhhgfh");
            c1.setPhone("2222-2222-12");
            c1.setState("");
            c1.setZipCode("");
            a.setBillingContact(c1);

            ZEDOAPIStub.Contact c2 = new ZEDOAPIStub.Contact();
            c2.setAddress1("");
            c2.setAddress2("");
            c2.setCity("");
            c2.setCountry("");
            c2.setEmail("rrrr     rrrrrrr       rrrrrr");
            c2.setFax("");
            c2.setFirstName("");
            c2.setLastName("");
            c2.setPhone("eeee eeeeeeeee          eeeee");
            c2.setState("");
            c2.setZipCode("");
            a.setSalesContact(c2);

ZEDOAPIStub.Tag[] tag1= new ZEDOAPIStub.Tag[2];
 tag1[0] = new ZEDOAPIStub.Tag();
 tag1[0].setName("tag1");
 tag1[0].setValue("value1");
tag1[1]= new ZEDOAPIStub.Tag();
tag1[1].setName("tag5");
tag[1].setValue("value5");
 
 a.setTags(tag1);
 
 ZEDOAPIStub.Tag[] tag= new ZEDOAPIStub.Tag[1];
 tag[0] = new ZEDOAPIStub.Tag();
 tag[0].setName("tag6");
 tag[0].setValue("value6");
 
 a.setDeleteTags(tag);

            ZEDOAPIStub.UpdateAdvertiser ua = new ZEDOAPIStub.UpdateAdvertiser();
            ua.setAdv(a);
            Thread.sleep(1000);
            stub.updateAdvertiser(ua);
            
            System.out.println("UPDATE_ADVERTISER COMPLETE!");
            System.out.println("PLEASE: " + ua.getAdv().getName() + " " + ua.getAdv().getId());

        } catch (Exception e) {
            System.err.println("ERROR: UPDATE_ADVERTISER 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 
         */
        $advertiser_id = 1350182;
        $param = new getAdvertiser($advertiser_id);
        
        /**
         *Execute API Call 
         */
        try {
        $response = $stub->getAdvertiser($param);
        }catch (SoapFault $ex) {
            var_dump($ex->faultcode, $ex->faultstring, $ex->detail);                echo "GET ADVERTISER FAILED\n";
                die();
        }
        
        /**
         * Response
         */
        $tmp = new getAdvertiserResponse($response);
        $tmp = $tmp->return;
        $advertiser = $tmp->return;
        /**
         * Edit Advertiser
         */
        
        $contact = new Contact();
        $contact->address1="address1";
        $contact->address2="address2";
        $contact->city="city";
        $contact->companyName="companyName";
        $contact->country="country";
        $contact->email="email";
        $contact->fax="fax";
        $contact->firstName="firstName";
        $contact->lastName="lastname";
        $contact->phone="phone";
        $contact->state="state";
        $contact->zipCode="zipCode";
        $advertiser->billingContact=$contact;
        $advertiser->salesContact=contact;
        
 $tag=Array();
 $tag[0]=new Tag();
 $tag[0]->name="tag5";
 $tag[0]->value="value5";
 $advertiser->tags=$tag;

 $tag1= Array();
 $tag1[0]=new Tag();
 $tag1[0]->name="tag6";
 $tag1[0]->value="value6";
 $advertiser->deleteTags=$tag1;
        /**
         * Update Advertiser
         */
        print_r($advertiser);
        $updateAdvertiser = new updateAdvertiser($advertiser);
        try {
        $response = $stub->updateAdvertiser($updateAdvertiser);
        }catch (SoapFault $ex) {
            var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "UPDATE ADVERTISER FAILED\n";
                die();
        }

SOAP

Request

POST /axis2/services/ZEDOAPI?wsdl HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:updateAdvertiser"
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:updateAdvertiser xmlns:ns5="http://zapi.zedo.com">
<ns5:adv>
<ns1:actionType xmlns:ns1="http://client.api.zedo.com/xsd">1</ns1:actionType>
<actions xmlns="http://client.api.zedo.com/xsd">
<itemNumber>1</itemNumber>
<maxLifeTime>15</maxLifeTime>
<name>myNameis</name>
<rate>4.0</rate>
<status>A</status>
<url>http://</url>
</actions>
<actions xmlns="http://client.api.zedo.com/xsd">
<itemNumber>2</itemNumber>
<maxLifeTime>15</maxLifeTime>
<name>qwerty</name>
<rate>0.0</rate>
<status>A</status>
<url>http://</url>
</actions>
<actions xmlns="http://client.api.zedo.com/xsd">
<itemNumber>3</itemNumber>
<maxLifeTime>15</maxLifeTime>
<name> </name>
<rate>0.0</rate>
<status>I</status>
<url>http://</url>
</actions>
<actions xmlns="http://client.api.zedo.com/xsd">
<itemNumber>4</itemNumber>
<maxLifeTime>15</maxLifeTime>
<name> </name>
<rate>0.0</rate>
<status>I</status>
<url>http://</url>
</actions>
<actions xmlns="http://client.api.zedo.com/xsd">
<itemNumber>5</itemNumber>
<maxLifeTime>15</maxLifeTime>
<name>rty </name>
<rate>9.0</rate>
<status>A</status>
<url>http://</url>
</actions>
<actions xmlns="http://client.api.zedo.com/xsd">
<itemNumber>6</itemNumber>
<maxLifeTime>15</maxLifeTime>
<name> </name>
<rate>0.0</rate>
<status>I</status>
<url>http://</url>
</actions>
<actions xmlns="http://client.api.zedo.com/xsd">
<itemNumber>7</itemNumber>
<maxLifeTime>15</maxLifeTime>
<name> </name>
<rate>0.0</rate>
<status>I</status>
<url>http://</url>
</actions>
<actions xmlns="http://client.api.zedo.com/xsd">
<itemNumber>8</itemNumber>
<maxLifeTime>15</maxLifeTime>
<name> </name>
<rate>0.0</rate>
<status>I</status>
<url>http://</url>
</actions>
<actions xmlns="http://client.api.zedo.com/xsd">
<itemNumber>9</itemNumber>
<maxLifeTime>15</maxLifeTime>
<name> </name>
<rate>0.0</rate>
<status>I</status>
<url>http://</url>
</actions>
<actions xmlns="http://client.api.zedo.com/xsd">
<itemNumber>10</itemNumber>
<maxLifeTime>15</maxLifeTime>
<name> </name>
<rate>0.0</rate>
<status>I</status>
<url>http://</url>
</actions>
<billingContact xmlns="http://client.api.zedo.com/xsd">
<address1>er</address1>
<address2>er</address2>
<city>er</city>
<companyName>
</companyName>
<country>er</country>
<email>mail</email>
<fax>
</fax>
<firstName>firstName</firstName>
<lastName>er</lastName>
<phone>er</phone>
<state>er</state>
<zipCode>er</zipCode>
</billingContact>
<ns1:createdBy xmlns:ns1="http://client.api.zedo.com/xsd">41107</ns1:createdBy>
<ns1:createdDate xmlns:ns1="http://client.api.zedo.com/xsd">2016-01-20 04:24:39</ns1:createdDate>
<ns1:id xmlns:ns1="http://client.api.zedo.com/xsd">1173688</ns1:id>
<ns1:max_lifetime xmlns:ns1="http://client.api.zedo.com/xsd">15</ns1:max_lifetime>
<ns1:modifiedBy xmlns:ns1="http://client.api.zedo.com/xsd">41107</ns1:modifiedBy>
<ns1:modifiedDate xmlns:ns1="http://client.api.zedo.com/xsd">2016-01-20 04:24:39</ns1:modifiedDate>
<ns1:name xmlns:ns1="http://client.api.zedo.com/xsd">ads1</ns1:name>
<salesContact xmlns="http://client.api.zedo.com/xsd">
<address1>drty</address1>
<address2>ert</address2>
<city>ert</city>
<companyName>
</companyName>
<country>sdf</country>
<email>etf</email>
<fax>34</fax>
<firstName>wer</firstName>
<lastName>wrwe</lastName>
<phone>52346</phone>
<state>45</state>
<zipCode>64</zipCode>
</salesContact>
<ns1:status xmlns:ns1="http://client.api.zedo.com/xsd">I</ns1:status>
 <ax24:deleteTags type="com.zedo.api.client.Tag">
 <ax24:name>tag5</ax24:name>
 <ax24:value>value5</ax24:value>
 </ax24:deleteTags>
 <ax24:tags type="com.zedo.api.client.Tag">
 <ax24:name>tag6</ax24:name>
 <ax24:value>value6</ax24:value>
 </ax24:tags>
</ns5:adv>
</ns5:updateAdvertiser>
</soapenv:Body>
</soapenv:Envelope>

Response


HTTP/1.1 200 OK
Date: Thu, 21 Jan 2016 07:03:34 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8; action="urn:updateAdvertiserResponse"

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:updateAdvertiserResponse xmlns:ns="http://zapi.zedo.com">
<ns:return>0</ns:return>
</ns:updateAdvertiserResponse>
</soapenv:Body>
</soapenv:Envelope>