Hi Kevin, Thanks for your reply. I got the solution for this error. It is mandatory to specify the client account Id when we are trying to setting the schedules and target for a campaign. If we didn't specify the client account id in AdWordsUser object, this error will occur.
On Friday, May 4, 2012 7:42:48 PM UTC+5:30, Kevin Winter wrote: > > Hi, > Are you making calls against production or sandbox? IDs from production > will not work in sandbox and vice versa. Can you retrieve this campaign > using a Predicate on Id using CampaignService.get? > > - Kevin Winter > AdWords API Team > > On Wednesday, May 2, 2012 5:29:13 AM UTC-4, Atul wrote: >> >> Hi, >> >> I am getting an Error of EntityNotFound.INVALID_ID while I am trying to >> set ad schedule for a particular campaign using its Id. Here is the code >> that I am using for this : >> >> CampaignTargetService campaignTargetService = >> (CampaignTargetService)user.GetService(AdWordsService.v201109.CampaignTargetService); >> >> >> AdScheduleTargetList scheduleTargetList = new AdScheduleTargetList(); >> >> scheduleTargetList.campaignId = 1234567; //Campaign Id for which I want >> to set ad schedule >> >> AdScheduleTarget scheduleTarget = new AdScheduleTarget(); >> scheduleTarget.dayOfWeek = >> Google.Api.Ads.AdWords.v201109.DayOfWeek.MONDAY; >> >> scheduleTarget.startHour = 10; >> scheduleTarget.startMinute = MinuteOfHour.ZERO; >> >> scheduleTarget.endHour = 11; >> scheduleTarget.endMinute = MinuteOfHour.ZERO; >> >> scheduleTarget.bidMultiplier = 1.0; >> >> scheduleTargetList.targets = new AdScheduleTarget[] { scheduleTarget }; >> >> CampaignTargetOperation scheduleTargetOperation = new >> CampaignTargetOperation(); >> scheduleTargetOperation.@operator = Operator.SET; >> scheduleTargetOperation.operand = scheduleTargetList; >> >> bool result = false; >> >> try >> { >> >> CampaignTargetReturnValue retVal = campaignTargetService.mutate(new >> CampaignTargetOperation[] { scheduleTargetOperation }); >> >> if (retVal != null && retVal.value != null) >> >> { >> >> result = true; >> >> } >> >> else result = false; >> >> } >> catch (Exception ex) >> { >> >> result = false; >> >> } >> return result; >> >> >> Always while I am executing this, it is showing an exception with this >> InnerException : "[EntityNotFound.INVALID_ID @ >> operations[0].operand.campaignId]" >> I also checked the CampaignId that I am entering, It was right. >> >> The same error I am getting while I am trying to set target criteria. I >> am using following code for this : >> >> CampaignCriterionService campaignCriterionService = >> (CampaignCriterionService)user.GetService(AdWordsService.v201109.CampaignCriterionService); >> >> long campaignId = 1234567; //Campaign Id for which I want to set >> location, language and platform >> >> CampaignCriterion languageCampaignCriteria = new CampaignCriterion(); >> >> Language language = new Language(); >> language.id = 1000; >> languageCampaignCriteria.campaignId = campaignId; >> languageCampaignCriteria.criterion = language; >> >> CampaignCriterion locationCampaignCriteria = new CampaignCriterion(); >> >> Location location = new Location(); >> location.id = 2356; >> locationCampaignCriteria.campaignId = campaignId; >> locationCampaignCriteria.criterion = location; >> >> CampaignCriterion platformCampaignCriteria = new CampaignCriterion(); >> >> Platform platform = new Platform(); >> platform.id = 30000; >> platformCampaignCriteria.campaignId = campaignId; >> platformCampaignCriteria.criterion = platform; >> >> CampaignCriterionOperation[] operation = new >> CampaignCriterionOperation[3]; >> operation[0] = new CampaignCriterionOperation(); >> operation[0].@operator = Operator.ADD; >> operation[0].operand = languageCampaignCriteria; >> >> operation[1] = new CampaignCriterionOperation(); >> operation[1].@operator = Operator.ADD; >> operation[1].operand = locationCampaignCriteria; >> >> operation[2] = new CampaignCriterionOperation(); >> operation[2].@operator = Operator.ADD; >> operation[2].operand = platformCampaignCriteria; >> >> bool result = false; >> try >> { >> >> CampaignCriterionReturnValue retVal = >> campaignCriterionService.mutate(operation); >> >> >> if (retVal != null && retVal.value != null) >> >> { >> >> result = true; >> >> } >> >> else result = false; >> >> } >> catch (Exception ex) >> { >> >> result = false; >> >> } >> return result; >> >> >> In this I am getting following InnerException : >> "[EntityNotFound.INVALID_ID @ operations[0].operand, >> EntityNotFound.INVALID_ID @ operations[1].operand, >> EntityNotFound.INVALID_ID @ operations[2].operand]" >> >> Please help me out for this issue, why I am getting this error even after >> the IDs are right for everthing i.e. campaign, location, language, platform >> etc. >> >> Thanks in advance. >> > -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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