Can anyone use campaign service on SandBox?

36 views
Skip to first unread message

PPL

unread,
Mar 31, 2009, 2:32:33 AM3/31/09
to AdWords API Forum
Hi,
I'm facing a problem in using getAllAdWordsCampaigns() and getCampaign
() methods of Campaign Service on SandBox. Whenever I called those
methods it leads to exception of null although I set everything about
the AdwordsUser correctly. I use the following constructor to create
AdwordsUser.
AdWordsUser user=new AdWordsUser(loginEmail, loginPassword,
clientEmail,
userAgent, developerToken, "",
"v13",new URL("https://sandbox.google.com"));

And I've already add campaigns by using addCampaign() method.
campaignService.addCampaign(newCampaign).
and I got the id of the new campaign. But when I get back the campaign
by passing that id to getCampaign() method it also ends up to null
exception. Could u please help me? I'm facing the same exception in
adding adgroups into sandbox too.
Thanks
PPL

AdWords API Advisor

unread,
Mar 31, 2009, 10:33:53 AM3/31/09
to AdWords API Forum
Hello,

Before debugging this further, I wanted to point out that the
Sandbox's backend database had its monthly refresh this past Friday
(see http://groups.google.com/group/adwords-api/browse_thread/thread/92e92378110a5086),
so any existing campaigns created before then will have to be
recreated.

If that's not the issue, could you please post the XML from a SOAP
request to the Sandbox and response (with your email and password
information X-ed out) illustrating the issue you're having?

Cheers,
-Jeff Posnick, AdWords API Team

PPL

unread,
Apr 1, 2009, 12:22:32 AM4/1/09
to AdWords API Forum
Now I've got it Jeff.
It was because of the database refresh.
Thank you for your care.

And I have one more question about keyword max cpc.
Whenever I add adgroup into the campaign, the following error was
appeared.

Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}
Server.userException
faultSubcode:
faultString: One or more input elements failed validation.
faultActor:
faultNode:
faultDetail:
{https://adwords.google.com/api/adwords/v13}fault:
<ns1:code>122</ns1:code>

<ns1:message>One or more input elements failed validation.</
ns1:message>

<ns1:errors>
<ns1:index>0</ns1:index>

<ns1:field>keywordMaxCpc</ns1:field>

<ns1:trigger>100000</ns1:trigger>

<ns1:code>75</ns1:code>

<ns1:isExemptable>false</ns1:isExemptable>

<ns1:detail>The bid must be a multiple of the billable unit.</
ns1:detail>

</ns1:errors>

So, could you please tell me what should be the multiple of the
billable unit about the keywordMaxCpc.

Thanks and best regards,
PPL

On Mar 31, 10:33 pm, AdWords API Advisor
<adwordsapiadvi...@google.com> wrote:
> Hello,
>
>  Before debugging this further, I wanted to point out that the
> Sandbox's backend database had its monthly refresh this past Friday
> (seehttp://groups.google.com/group/adwords-api/browse_thread/thread/92e92...),
> > PPL- Hide quoted text -
>
> - Show quoted text -

AdWords API Advisor

unread,
Apr 1, 2009, 1:44:13 PM4/1/09
to AdWords API Forum
Hello,

Which currency code are you using after the '++' at the end of your
Sandbox Developer token? It sounds like whichever one you're using
can't be easily broken down into tenths for billing purposes. (100000
micros = 1/10 of one unit of currency.)

Cheers,
-Jeff Posnick, AdWords API Team


PPL

unread,
Apr 2, 2009, 5:50:41 AM4/2/09
to AdWords API Forum
Hello Jeff,

Now I'm using JPY at the end of the Sandbox Developer token.
Do I need to use specific currency code like USD or whatever?
And there is one more question about adding Website Criterion into the
adgroup.
Whenever I add the website criterion into the adgroup it leads to null
exception,
although I can add keyword criterion into the adgroup and I'm not
adding both keyword and website in the same adgroup.
Could you please help me?

Thanks and best regards,
PPL

On Apr 2, 1:44 am, AdWords API Advisor <adwordsapiadvi...@google.com>
> > > - Show quoted text -- Hide quoted text -

AdWords API Advisor

unread,
Apr 2, 2009, 11:16:15 AM4/2/09
to AdWords API Forum
Hello PPL,

You can use JPY as your currency, but I don't think you can specify
1/10 of a Yen as a valid bid. Try specifying a number that's a
multiple of 1000000--for example, 5000000 would be a bid of 5 Yen.

As I mentioned upthread, in order to troubleshoot, could you please
post the XML from a SOAP request to the Sandbox and response (with
your email and password information X-ed out) illustrating the issue
you're having?

Cheers,
-Jeff Posnick, AdWords API Team


PPL

unread,
Apr 6, 2009, 6:47:42 AM4/6/09
to AdWords API Forum
Hello Jeff,

KeywordMaxCpc is ok now.

The following is the code about adding the website criterion into
adGroup.

String alternateUrl = "https://sandbox.google.com";

AdWordsUser user=new AdWordsUser(loginEmail, loginPassword,
clientEmail,
"", devToken, "",
"v13",new URL(alternateUrl));
CampaignInterface campaignService =
(CampaignInterface) user.getService
(AdWordsUser.CAMPAIGN_SERVICE);
AdGroupInterface adgroupService =
(AdGroupInterface) user.getService
(AdWordsUser.AD_GROUP_SERVICE);
AdInterface adService =
(AdInterface) user.getService(AdWordsUser.AD_SERVICE);
CriterionInterface criterionService =
(CriterionInterface) user.getService
(AdWordsUser.CRITERION_SERVICE);

Campaign newCampaign = new Campaign();
newCampaign.setBudgetAmount(new Long(100000000));
newCampaign.setBudgetPeriod(BudgetPeriod.Daily);

GeoTarget g_target = new GeoTarget();
String[] countries = {"FR", "ES"};
CountryTargets country = new CountryTargets();
country.setCountries(countries);
g_target.setCountryTargets(country);
newCampaign.setGeoTargeting(g_target);
String[] languages = {"en", "fr", "es"};

newCampaign.setLanguageTargeting(languages);
newCampaign.setStatus(CampaignStatus.Paused);

newCampaign = campaignService.addCampaign(newCampaign);
int campaign_id = newCampaign.getId();

AdGroup myAdGroup = new AdGroup();
myAdGroup.setKeywordMaxCpc(new Long(1000000));

AdGroup newAdGroup = adgroupService.addAdGroup(campaign_id,
myAdGroup);
long adgroup_id = newAdGroup.getId();

TextAd myAd = new TextAd();
myAd.setHeadline("AdWords API Dev Guide");
myAd.setDescription1("Access your AdWords");
myAd.setDescription2("accounts programmatically");
myAd.setDisplayUrl("blog.chanezon.com");
myAd.setDestinationUrl("http://blog.chanezon.com/");
myAd.setAdGroupId(adgroup_id);
Ad[] ads = new Ad[1];
ads[0] = myAd;
ads = adService.addAds(ads);

Website website1 = new Website();
website1.setCriterionType(CriterionType.Website);
website1.setUrl("example.com");

boolean noError = false;
Criterion[] newWebsite ;
String[] languageTarget = new String[] {"en"};
GeoTarget geoTarget = new GeoTarget();
geoTarget.setCountryTargets(new CountryTargets(new String[]
{"US"},new String[]{}));
ApiError[] errors = criterionService.checkCriteria(new Criterion[]
{website1}, languageTarget, geoTarget);

if (errors == null) {
noError = true;
}
if(noError) newWebsite = criterionService.addCriteria(new
Criterion[] {website1});

The null error appears at this sentence whether I checked criteria or
not.
if(noError) newWebsite = criterionService.addCriteria(new Criterion
[] {website1});

Adding keyword and Ad are ok.
I used the same infomation about account.

Thanks and best regards,
PPL

On Apr 2, 11:16 pm, AdWords API Advisor <adwordsapiadvi...@google.com>

AdWords API Advisor

unread,
Apr 6, 2009, 2:00:23 PM4/6/09
to AdWords API Forum
Hello,

What I'd need to see is the log of the SOAP request and response, not
the source code. I'm not sure what SOAP toolkit or client library
you're using, but could you please take the appropriate steps to turn
on SOAP message logging and pass along the request and response SOAP
messages (with the confidential request header information X-ed out)?

Cheers,
-Jeff Posnick, AdWords API Team


Reply all
Reply to author
Forward
0 new messages