Jeff, Finally I found that I am getting this error. Report job failed validation due to the following error: "This account has reached its user specified budget.".
Now Could you please help me why am I getting this error? What is cause of this problem ? How it can be resolved ? Thanks in advance. Raj Report job failed validation due to the following error: "This account has reached its user specified budget.". On Jan 21, 7:54 am, AdWords API Advisor <adwordsapiadvi...@google.com> wrote: > Additionally, and more importantly, if you're doing new development as > part of something more than a one-off project, I would recommend that > you use the Java client library instead of just following along with > the sample code, which assumes you're generating your own SOAP > bindings using Axis. > > To quote from the Code Samples > page,http://code.google.com/intl/en/apis/adwords/docs/samples.html > > "These code samples demonstrate simple interactions with AdWords using > various SOAP toolkits. They are designed to help you better understand > the basics of AdWords API. > > For code intended to help you develop complex applications, download > one of the AdWords API client libraries." > > I'm not saying that the sample code shouldn't work, and if you have a > strong reason for not wanting to go that route instead of the client > library then we should be able to figure out what's wrong (providing a > SOAP trace or getting the additional details from the SOAP fault as > Tino suggests should be the first step). Using the official client > library will allow you to develop against all of the services in the > AdWords API in a unified manner, using a shared common object to > represent your credentials, and allow you to take advantage of the > built-in logging and unit accounting methods it offers. > > Cheers, > -Jeff Posnick, AdWords API Team > > On Jan 21, 3:39 am, "Tino Hertlein" <t...@refinedlabs.com> wrote: > > > Hi Rajni, > > > there are some additional properties in the APIException that is thrown: > > > int code; > > com.google.api.adwords.v13.ApiError[] errors; > > boolean internal; > > java.lang.String message1; > > java.lang.String trigger; > > > If you print the content of these properties in your catch-block, the error > > might become obvious. > > > Tino > > > -- > > Refined Labs GmbH > > Landwehrstraße 17 > > 80336 München > > Tel +49 89 1392879-0 > > t...@refinedlabs.comhttp://www.refinedlabs.com > > > Sitz: München > > AG München HRB 166589 > > Geschäftsführer: > > Thomas Bindl, Stephan Seitz > > > -----Ursprüngliche Nachricht----- > > Von: adwords-api@googlegroups.com [mailto:adwords-...@googlegroups.com] Im > > Auftrag von raj > > Gesendet: Mittwoch, 21. Januar 2009 00:37 > > An: AdWords API Forum > > Betreff: AdWords API Re: Report job failed validation due to the following > > error: "null". > > > Jeff, > > I have already defined this job with required parameters for soap > > headers.Please see my code below mentioned here. It prints "Jeff" that > > I did for testing purpose. But it fails after that. It did not print > > hello. I took this code from sample code that are available at Ad > > words website in the sample code section for reportService. I just > > changed startday and endDay as parameters only. That's the only change > > I did and added my required parameter for soap header. > > > private static final String namespace = "https://adwords.google.com/ > > api/adwords/v12"; > > > public static void main(String[] args) { > > try { > > // Set up service connection. > > ReportInterface service = new ReportServiceLocator > > ().getReportService(); > > > // Define SOAP headers. > > ((Stub) service).setHeader(namespace, "email", email); > > ((Stub) service).setHeader(namespace, "password", password); > > ((Stub) service).setHeader(namespace, "clientEmail", > > clientEmail); > > ((Stub) service).setHeader(namespace, "useragent", useragent); > > ((Stub) service).setHeader(namespace, "developerToken", > > developerToken); > > ((Stub) service).setHeader(namespace, "applicationToken", > > applicationToken); > > > // Create report job structure. > > DefinedReportJob job = new DefinedReportJob(); > > job.setSelectedReportType("Keyword"); > > job.setName("Sample Keyword Report"); > > job.setAggregationTypes(new String[] {"Summary"}); > > job.setAdWordsType(AdWordsType.SearchOnly); > > job.setKeywordType(KeywordType.Broad); > > > Calendar startDay = Calendar.getInstance(); > > //here set as > > today that I saw on adwords web site > > GregorianCalendar endDay = new GregorianCalendar(2037, > > Calendar.DECEMBER,30); //here to set end date > > > job.setStartDay(startDay); > > job.setEndDay(endDay); > > job.setSelectedColumns(new String[] { > > "Campaign", "AdGroup", "Keyword", "KeywordStatus", > > "KeywordMinCPC", > > "KeywordDestUrlDisplay", "Impressions", "Clicks", "CTR", > > "AveragePosition"}); > > > // Validate report. > > try { > > System.out.println("Jeff"); // till > > now > > it is fine > > service.validateReportJob(job); //fails here > > System.out.println("hello"); > > // Schedule report. > > long jobId = service.scheduleReportJob(job); > > > // Wait for report to finish. > > ReportJobStatus status = service.getReportJobStatus(jobId); > > while(status != ReportJobStatus.Completed && > > status != ReportJobStatus.Failed) { > > System.out.println( > > "Report job status is \"" + status.getValue() + > > "\"."); > > try { > > Thread.sleep(30000); > > } catch(InterruptedException e) {} > > status = service.getReportJobStatus(jobId); > > } > > > if(status == ReportJobStatus.Failed) { > > System.out.println("Report job generation failed."); > > System.exit(0); > > } > > > // Download report. > > String url = service.getGzipReportDownloadUrl(jobId); > > System.out.println("Report is available at \"" + url + > > "\"."); > > } catch (ApiException e) { > > System.out.println( > > "Report job failed validation due to the following > > error: > > \"" > > + e.getMessage() + "\"."); > > } > > } catch(Exception e) { > > e.printStackTrace(); > > } > > } > > } > > > Could you please help why it's not validating report ?===============> > > service.validateReportJob(job); //fails here > > I did not make any change.I just called this API. I checked in the > > code also.It should take job as input parameter that I did here. > > Thanks > > Rajni > > > On Jan 20, 2:56 pm, AdWords API Advisor <adwordsapiadvi...@google.com> > > wrote: > > > > My mistake--I always confuse Java and C# unless I pay close attention > > > to the System.out vs. Console stuff. In any case, there's the Java > > > client library that would be a better choice: > > > > http://code.google.com/p/google-api-adwords-java/ > > > > There's an example included with the Java client library for > > > scheduling and downloading a report, which will be in XML format. > > > You'll have to change some of the report options to match exactly what > > > you're looking for, using this information as your guide: > > > > http://code.google.com/intl/en/apis/adwords/docs/developer/DefinedRep... > > > > Cheers, > > > -Jeff Posnick, AdWords API Team > > > > On Jan 20, 5:47 pm, raj <adp-...@adp.com> wrote: > > > > > My development environment is java and axis. I have all the wsdls and > > > > all the java classes. As per our last meeting in my company, it's > > > > fixed that we need to develope all the code in java. Becuase we are > > > > currently working in java side not in dot net side. My target is to > > > > get .xml file for clicks, impressions, average position etc for > > > > campaigns. That can be done either this way that I have found in other > > > > ad words > > > > linkhttp://www.mail-archive.com/adwords-api@googlegroups.com/msg01351.html > > > > . As we know getCampaignStats method contains clicks, impressions etc. > > > > As you can see in my code below. > > > > private static final String namespace = "https://adwords.google.com/ > > > > api/adwords/v12"; > > > > private static int[] campaignIds; > > > > static Calendar endDay; > > > > static Calendar startDay ; > > > > > public static void main(String[] args) throws Exception { > > > > try { > > > > // Set up service connection. > > > > CampaignInterface service = new CampaignServiceLocator > > > > ().getCampaignService(); > > > > > // Define SOAP headers. > > > > ((Stub) service).setHeader(namespace, "email", email); > > > > ((Stub) service).setHeader(namespace, "password", password); > > > > ((Stub) service).setHeader(namespace, "clientEmail", clientEmail); > > > > ((Stub) service).setHeader(namespace, "useragent", useragent); > > > > ((Stub) service).setHeader(namespace, "developerToken", > > > > developerToken); > > > > ((Stub) service).setHeader(namespace, "applicationToken", > > > > applicationToken); > > > > StatsRecord[] campaigns = null; > > > > // Get all campaigns. > > > > campaigns = service.getCampaignStats(campaignIds,startDay,endDay); > > > > for(int i = 0; i < 10; i++) > > > > { > > > > System.out.println("The value is " +campaigns[i].getClicks()); > > > > System.out.println("The value is " > > > > +campaigns[i].getImpressions()); > > > > > > ... > > read more » --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en -~----------~----~----~----~------~----~------~--~---