Hi,

I am unable to create TextAd using Google AdWords JAVA API. Can anyone send 
me the java source to create the same.

Code:

TextAd textAd = new TextAd();
   textAd.setHeadline("Test Headline");
   textAd.setDescription1("Description1");
   textAd.setDescription2("Description2");
   textAd.setFinalUrls(new String[] {"http://cloudsense.com"});


AdGroupAdServiceInterface adGroupAdService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);
AdGroupAd adGroupAd = new AdGroupAd();
                  adGroupAd.setAdGroupId(adgroupid);
                  adGroupAd.setAd(textAd);
                  adGroupAd.setStatus("PAUSED");
AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation();
                  adGroupAdOperation.setOperand(adGroupAd);
                  adGroupAdOperation.setOperator(Operator.ADD);




    AdGroupAdReturnValue result = adGroupAdService.mutate(adGroupAdOperation 
);




Am getting the following error:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
    <soap:Header>
        <ResponseHeader xmlns=
"https://adwords.google.com/api/adwords/cm/v201809";>
            <requestId>00058e7b34c209b90aa78213c00de258</requestId>
            <serviceName>AdGroupAdService</serviceName>
            <methodName>mutate</methodName>
            <operations>1</operations>
            <responseTime>240</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Client</faultcode>
            <faultstring>[AdGroupAdError.CANNOT_CREATE_TEXT_ADS @ 
operations[0].operand.ad]</faultstring>
            <detail>
                <ApiExceptionFault xmlns=
"https://adwords.google.com/api/adwords/cm/v201809";>
                    <message>[AdGroupAdError.CANNOT_CREATE_TEXT_ADS @ 
operations[0].operand.ad]</message>
                    <ApplicationException.Type>ApiException
</ApplicationException.Type>
                    <errors xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"; xsi:type="AdGroupAdError">
                        <fieldPath>operations[0].operand.ad</fieldPath>
                        <fieldPathElements>
                            <field>operations</field>
                            <index>0</index>
                        </fieldPathElements>
                        <fieldPathElements>
                            <field>operand</field>
                        </fieldPathElements>
                        <fieldPathElements>
                            <field>ad</field>
                        </fieldPathElements>
                        <trigger/>
                        <errorString>AdGroupAdError.CANNOT_CREATE_TEXT_ADS
</errorString>
                        <ApiError.Type>AdGroupAdError</ApiError.Type>
                        <reason>CANNOT_CREATE_TEXT_ADS</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>


Suresh

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/258f4481-98be-45d2-aab6-67156fa74243%40googlegroups.com.

Reply via email to