I am trying to create ad for adgroup but getting following error: faultString: 
[AdError.INVALID_AD_TYPE @ operations[0].operand.ad]

this is my code:

AdGroupAdProxy adGroupAdProxy= new AdGroupAdProxy(session, services);
adGroupAdProxy.createNewAd("TextAd", "http://example/12123.html";, adGroupId);

public Long createNewAd(String adType, String displayUrl, Long adGroupId) 
throws ApiException, RemoteException{

Ad newAd = new Ad();
newAd.setAdType(adType);
newAd.setDisplayUrl(displayUrl);

AdGroupAd newAdGroupAd = new AdGroupAd();
newAdGroupAd.setAd(newAd);
newAdGroupAd.setAdGroupId(adGroupId);

AdGroupAdOperation operations = new AdGroupAdOperation();
operations.setOperand(newAdGroupAd);
operations.setOperator(Operator.ADD);

    Long adId = adGroupAdService.mutate(new AdGroupAdOperation[] 
{operations}).getValue(0).getAd().getId();
    return adId;

}

I was looking into Ad types which should be supplied to API but no luck to 
find it. Could you please point me to my problem?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to