Hi, Here is an example using CampaignFeedService. AdGroupFeedService xml would look similar.
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"> <soap:Header> <RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201409" > <developerToken>******</developerToken> <clientCustomerId>******</clientCustomerId> <userAgent>INSERT_YOUR_COMPANY_OR_APPLICATION_NAME_HERE (AwApi-DotNet/18.7.0, Common-Dotnet/3.5.0, .NET CLR/4.0.30319.34209, gzip) </userAgent> </RequestHeader> </soap:Header> <soap:Body> <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201409"> <operations> <operator>ADD</operator> <operand> <feedId>24316877</feedId> <campaignId>35566846</campaignId> <matchingFunction> <operator>AND</operator> <lhsOperand xsi:type="FunctionOperand"> <value> <operator>IN</operator> <lhsOperand xsi:type="RequestContextOperand"> <contextType>FEED_ITEM_ID</contextType> </lhsOperand> <rhsOperand xsi:type="ConstantOperand"> <type>LONG</type> <longValue>1045918788</longValue> </rhsOperand> <rhsOperand xsi:type="ConstantOperand"> <type>LONG</type> <longValue>1045918791</longValue> </rhsOperand> <rhsOperand xsi:type="ConstantOperand"> <type>LONG</type> <longValue>1045918794</longValue> </rhsOperand> <rhsOperand xsi:type="ConstantOperand"> <type>LONG</type> <longValue>1045918797</longValue> </rhsOperand> <rhsOperand xsi:type="ConstantOperand"> <type>LONG</type> <longValue>1045918800</longValue> </rhsOperand> <rhsOperand xsi:type="ConstantOperand"> <type>LONG</type> <longValue>1045918803</longValue> </rhsOperand> </value> </lhsOperand> <lhsOperand xsi:type="FunctionOperand"> <value> <operator>EQUALS</operator> <lhsOperand xsi:type="RequestContextOperand"> <contextType>DEVICE_PLATFORM</contextType> </lhsOperand> <rhsOperand xsi:type="ConstantOperand"> <type>STRING</type> <stringValue>Mobile</stringValue> </rhsOperand> </value> </lhsOperand> </matchingFunction> <placeholderTypes>1</placeholderTypes> </operand> </operations> </mutate> </soap:Body> </soap:Envelope> Cheers, Anash P. Oommen, AdWords API Advisor. On Wednesday, January 21, 2015 at 9:34:36 PM UTC+5:30, treto...@gmail.com wrote: > > Спасибо, я еще все на Java видел. Не могли бы вы привести пример именно > XML запроса, посылаемого на сервер? > > среда, 21 января 2015 г., 10:53:31 UTC+2 пользователь Anash P. Oommen > (AdWords API Team) написал: >> >> Hi, >> >> You could use an array of ConstantOperand to provide the FeedItem IDs. >> See the Java code example in our guide for more details. ( >> https://developers.google.com/adwords/api/docs/guides/feed-services#campaignfeedservice >> ) >> >> Cheers, >> Anash P. Oommen, >> AdWords API Advisor. >> >> On Tuesday, January 20, 2015 at 7:15:20 PM UTC+5:30, treto...@gmail.com >> wrote: >>> >>> Добрый день! >>> Пытаюсь послать запрос к сервису AdGroupFeedService. Текст запроса: >>> >>> "<?xml version=""1.0"" encoding=""UTF-8""?> >>> <soapenv:Envelope xmlns:soapenv="" >>> http://schemas.xmlsoap.org/soap/envelope/"" xmlns:v20="" >>> https://adwords.google.com/api/adwords/cm/v201409""> >>> <soapenv:Header> >>> <v20:RequestHeader> >>> <v20:clientCustomerId>clientCustomerId</v20:clientCustomerId> >>> <v20:developerToken>ХХХХХХХХХХХХХХ</v20:developerToken> >>> <v20:userAgent>ХХХХХ</v20:userAgent> >>> <v20:validateOnly>false</v20:validateOnly> >>> <v20:partialFailure>false</v20:partialFailure> >>> </v20:RequestHeader> >>> </soapenv:Header> >>> <soapenv:Body> >>> <v20:mutate> >>> <v20:operations xmlns:i="" >>> http://www.w3.org/2001/XMLSchema-instance""> >>> <v20:operator>"ADD"</v20:operator> >>> <v20:operand> >>> <v20:feedId>"feedId"</v20:feedId> >>> <v20:adGroupId>"adGroupId"</v20:adGroupId> >>> <v20:matchingFunction> >>> <v20:operator>IN</v20:operator> >>> <v20:lhsOperand xmlns:ns2="" >>> https://adwords.google.com/api/adwords/cm/v201409"" >>> i:type=""ns2:RequestContextOperand""> >>> <v20:contextType>FEED_ITEM_ID</v20:contextType> >>> </v20:lhsOperand> >>> </v20:matchingFunction> >>> <v20:placeholderTypes>1</v20:placeholderTypes> >>> <v20:status>ENABLED</v20:status> >>> </v20:operand> >>> </v20:operations> >>> </v20:mutate> >>> </soapenv:Body> >>> </soapenv:Envelope>"; >>> >>> При попытке послать запрос получаю ошибку: >>> >>> [FunctionError.INVALID_NUMBER_OF_OPERANDS @ >>> operations[0].operand.matchingFunction.rhsOperand] >>> >>> Т.е. нужно указать rhsOperand в тексте запроса: >>> >>> <v20:rhsOperand> >>> >>> <v20:FunctionArgumentOperand.Type>?</v20:FunctionArgumentOperand.Type> >>> </v20:rhsOperand> >>> >>> Как правильно сделать? Если можно, дайте пример реализации? >>> Спасибо! >>> >>> П.С. У меня нет возможности использовать клиентские библиотеки, я >>> пользуюсь только прямыми запросами к сервисам. Нужен в идеале пример >>> рабочего текста запроса к AdGroupFeedService. >>> >> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 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 --- 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 adwords-api+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/96a81f03-34cf-46f4-8deb-f56beef21996%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.