Hi, This error is being thrown because the date is formatted incorrectly. The correct format is Ymd, for example 20100729. I'll work with the core engineering team to have a better error thrown in this case.
Best, - Eric Koleda, AdWords API Team On Jul 28, 11:28 am, Christian Fuentes <khr...@gmail.com> wrote: > Trying to add a ReportDefinition I got this error, but the code is the > same as the example called AddKeywordsPerformanceReportDefinition, and > the credentials are OK (I got all my campaigns and adGroups from the > API). > > This is the code > > $adwords = new AdWordsUser(NULL, $email, $password, > $developerToken, $applicationToken, $userAgent, $clientIds['es']); > $adwords->LogDefaults(); > /* add report definition */ > // Get the GetReportDefinitionService. > $reportDefinitionService = $adwords- > > >GetReportDefinitionService('v201003'); > > $adGroupId = (float) 1312246342; > $startDate = date('Y-m-d', strtotime('-2 days')); > $endDate = date('Y-m-d', strtotime('yesterday')); > > // Create ad group predicate. > $adGroupPredicate = new Predicate(); > $adGroupPredicate->field = 'AdGroupId'; > $adGroupPredicate->operator = 'EQUALS'; > $adGroupPredicate->values = array($adGroupId); > > // Create selector. > $selector = new Selector(); > $selector->fields = array('AdGroupId', 'Id', 'KeywordText', > 'KeywordMatchType', 'Impressions', 'Clicks', 'Cost'); > $selector->predicates = array($adGroupPredicate); > $selector->dateRange = new DateRange($startDate, $endDate); > > // Create report definition. > $reportDefinition = new ReportDefinition(); > $reportDefinition->reportName = 'Keywords performance report #' . > time(); > $reportDefinition->dateRangeType = 'CUSTOM_DATE'; > $reportDefinition->reportType = 'KEYWORDS_PERFORMANCE_REPORT'; > $reportDefinition->downloadFormat = 'XML'; > $reportDefinition->selector = $selector; > > // Create operations. > $operation = new ReportDefinitionOperation(); > $operation->operand = $reportDefinition; > $operation->operator = 'ADD'; > > $operations = array($operation); > > // Add report definition. > $result = $reportDefinitionService->mutate($operations); > > Can someone please help... thanks -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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