Wow, thank you! I guess the way to deal with both problems is I can keep 
the predicate as is and include the status field in the selector. This way 
I can conditionally find the Id of either a paused or active campaign, or 
the first deleted campaign, in that order.


On Wednesday, March 26, 2014 10:31:15 AM UTC-4, Josh Radcliff (AdWords API 
Team) wrote:
>
> Hi,
>
> The issue here is that you are assuming that campaign names are unique 
> across all states.  However, the uniqueness rules in AdWords recently 
> changed so that you now can have multiple DELETED campaigns with the same 
> name, but names must be unique among ACTIVE or PAUSED campaigns.
>
> Using the case below as an example, here's the sequence of events:
>
> 1. Attempt to create an ACTIVE campaign with name "Test Campaign Name". 
>  This fails because there is already an ACTIVE campaign with that name.
> 2. Query campaigns by name and choose the first ID returned.  It just so 
> happens that this is an ID for a DELETED campaign.
> 3. Attempt to set the campaign found in step 2 to ACTIVE.  This fails 
> again because there is a different ACTIVE or PAUSED campaign with that 
> campaign's name.
>
> To fix this, you can modify step 2 to include a Predicate on 
> Status<https://developers.google.com/adwords/api/docs/reference/v201402/CampaignService.Campaign#status>
>  that 
> will only pick up ACTIVE or PAUSED campaigns, in which case you will get 
> back only *one* campaign from your *get* request.
>
> Keep in mind that this will only handle the case where the campaign that 
> already exists is in the ACTIVE or PAUSED state.  If one or more campaigns 
> already exist with the same name but they are DELETED then you will no 
> longer get an error. AdWords now lets you have one or more DELETED 
> campaigns with the same name, and that same name can also be used on one 
> (and only one) ACTIVE or PAUSED campaign.
>
> One final note is that we are aware that the UNEXPECTED_INTERNAL_API_ERROR 
> is not particularly helpful for the case where you set a DELETED campaign 
> to ACTIVE or PAUSED and there's a name conflict.  We're working on fixing 
> it to return a more informative exception message and type.
>
> Thanks,
> Josh, AdWords API Team
>
> On Tuesday, March 25, 2014 5:30:29 PM UTC-4, Namaan wrote:
>>
>> I tried hard-coding the duplicate campaign id into the campaign object 
>> for the initial campaign set operation and got the same error. As I don't 
>> see any one else complaining about downtime, is this more likely on my end?
>>
>> I was able to get the raw soap xml log posted below.
>>
>> [Mar 25 2014 17:16:29.000000 - ERROR] POST 
>> /api/adwords/cm/v201402/CampaignService?access_token=*** HTTP/1.1
>> Host: adwords.google.com
>> Connection: Keep-Alive
>> User-Agent: PHP-SOAP/5.4.3
>> Content-Type: text/xml; charset=utf-8
>> SOAPAction: ""
>> Content-Length: 1637
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <SOAP-ENV:Envelope xmlns:SOAP-ENV="
>> http://schemas.xmlsoap.org/soap/envelope/"; xmlns:ns1="
>> https://adwords.google.com/api/adwords/cm/v201402"; xmlns:xsi="
>> http://www.w3.org/2001/XMLSchema-instance";>
>>   <SOAP-ENV:Header>
>>     <ns1:RequestHeader>
>>       <ns1:clientCustomerId>***</ns1:clientCustomerId>
>>       <ns1:developerToken>***</ns1:developerToken>
>>       <ns1:userAgent>*** (AwApi-PHP/5.2.1, Common-PHP/5.2.1, 
>> PHP/5.4.3)</ns1:userAgent>
>>     </ns1:RequestHeader>
>>   </SOAP-ENV:Header>
>>   <SOAP-ENV:Body>
>>     <ns1:mutate>
>>       <ns1:operations>
>>         <ns1:operator>ADD</ns1:operator>
>>         <ns1:operand>
>>           <ns1:name>Test Campaign Name</ns1:name>
>>           <ns1:status>ACTIVE</ns1:status>
>>           <ns1:budget>
>>             <ns1:budgetId>236399064</ns1:budgetId>
>>           </ns1:budget>
>>           
>> <ns1:adServingOptimizationStatus>CONVERSION_OPTIMIZE</ns1:adServingOptimizationStatus>
>>           <ns1:settings xsi:type="ns1:KeywordMatchSetting">
>>             <ns1:optIn>true</ns1:optIn>
>>           </ns1:settings>
>>           <ns1:settings xsi:type="ns1:GeoTargetTypeSetting">
>>             
>> <ns1:positiveGeoTargetType>DONT_CARE</ns1:positiveGeoTargetType>
>>             
>> <ns1:negativeGeoTargetType>DONT_CARE</ns1:negativeGeoTargetType>
>>           </ns1:settings>
>>           <ns1:advertisingChannelType>SEARCH</ns1:advertisingChannelType>
>>           <ns1:networkSetting>
>>             <ns1:targetGoogleSearch>true</ns1:targetGoogleSearch>
>>             <ns1:targetSearchNetwork>false</ns1:targetSearchNetwork>
>>             <ns1:targetContentNetwork>false</ns1:targetContentNetwork>
>>           </ns1:networkSetting>
>>           <ns1:biddingStrategyConfiguration>
>>             <ns1:biddingStrategyType>MANUAL_CPC</ns1:biddingStrategyType>
>>           </ns1:biddingStrategyConfiguration>
>>         </ns1:operand>
>>       </ns1:operations>
>>     </ns1:mutate>
>>   </SOAP-ENV:Body>
>> </SOAP-ENV:Envelope>
>>
>> HTTP/1.1 500 Internal Server Error
>> Content-Type: text/xml; charset=UTF-8
>> Date: Tue, 25 Mar 2014 21:16:27 GMT
>> Expires: Tue, 25 Mar 2014 21:16:27 GMT
>> Cache-Control: private, max-age=0
>> X-Content-Type-Options: nosniff
>> X-Frame-Options: SAMEORIGIN
>> X-XSS-Protection: 1; mode=block
>> Server: GSE
>> Transfer-Encoding: chunked
>>
>> <?xml version="1.0"?>
>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
>>   <soap:Header>
>>     <ResponseHeader xmlns="
>> https://adwords.google.com/api/adwords/cm/v201402";>
>>       <requestId>0004f574dd738ad80ae6c94800004a0e</requestId>
>>       <serviceName>CampaignService</serviceName>
>>       <methodName>mutate</methodName>
>>       <operations>0</operations>
>>       <responseTime>249</responseTime>
>>     </ResponseHeader>
>>   </soap:Header>
>>   <soap:Body>
>>     <soap:Fault>
>>       <faultcode>soap:Server</faultcode>
>>       <faultstring>[CampaignError.DUPLICATE_CAMPAIGN_NAME @ operations[0].
>> operand.name; trigger:'Test Campaign Name']</faultstring>
>>       <detail>
>>         <ApiExceptionFault xmlns="
>> https://adwords.google.com/api/adwords/cm/v201402";>
>>           <message>[CampaignError.DUPLICATE_CAMPAIGN_NAME @ operations[0].
>> operand.name; trigger:'Test Campaign Name']</message>
>>           
>> <ApplicationException.Type>ApiException</ApplicationException.Type>
>>           <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
>> xsi:type="CampaignError">
>>             <fieldPath>operations[0].operand.name</fieldPath>
>>             <trigger>Test Campaign Name</trigger>
>>             
>> <errorString>CampaignError.DUPLICATE_CAMPAIGN_NAME</errorString>
>>             <ApiError.Type>CampaignError</ApiError.Type>
>>             <reason>DUPLICATE_CAMPAIGN_NAME</reason>
>>           </errors>
>>         </ApiExceptionFault>
>>       </detail>
>>     </soap:Fault>
>>   </soap:Body>
>> </soap:Envelope>
>>
>> [Mar 25 2014 17:16:30.000000 - INFO] POST 
>> /api/adwords/cm/v201402/CampaignService?access_token=*** HTTP/1.1
>> Host: adwords.google.com
>> Connection: Keep-Alive
>> User-Agent: PHP-SOAP/5.4.3
>> Content-Type: text/xml; charset=utf-8
>> SOAPAction: ""
>> Content-Length: 814
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <SOAP-ENV:Envelope xmlns:SOAP-ENV="
>> http://schemas.xmlsoap.org/soap/envelope/"; xmlns:ns1="
>> https://adwords.google.com/api/adwords/cm/v201402";>
>>   <SOAP-ENV:Header>
>>     <ns1:RequestHeader>
>>       <ns1:clientCustomerId>***</ns1:clientCustomerId>
>>       <ns1:developerToken>***</ns1:developerToken>
>>       <ns1:userAgent>*** (AwApi-PHP/5.2.1, Common-PHP/5.2.1, 
>> PHP/5.4.3)</ns1:userAgent>
>>     </ns1:RequestHeader>
>>   </SOAP-ENV:Header>
>>   <SOAP-ENV:Body>
>>     <ns1:get>
>>       <ns1:serviceSelector>
>>         <ns1:fields>Id</ns1:fields>
>>         <ns1:fields>Name</ns1:fields>
>>         <ns1:predicates>
>>           <ns1:field>Name</ns1:field>
>>           <ns1:operator>IN</ns1:operator>
>>           <ns1:values>Test Campaign Name</ns1:values>
>>         </ns1:predicates>
>>       </ns1:serviceSelector>
>>     </ns1:get>
>>   </SOAP-ENV:Body>
>> </SOAP-ENV:Envelope>
>>
>> HTTP/1.1 200 OK
>> Content-Type: text/xml; charset=UTF-8
>> Date: Tue, 25 Mar 2014 21:16:27 GMT
>> Expires: Tue, 25 Mar 2014 21:16:27 GMT
>> Cache-Control: private, max-age=0
>> X-Content-Type-Options: nosniff
>> X-Frame-Options: SAMEORIGIN
>> X-XSS-Protection: 1; mode=block
>> Server: GSE
>> Transfer-Encoding: chunked
>>
>> <?xml version="1.0"?>
>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
>>   <soap:Header>
>>     <ResponseHeader xmlns="
>> https://adwords.google.com/api/adwords/cm/v201402";>
>>       <requestId>0004f574dd78a7700ae68101000029bc</requestId>
>>       <serviceName>CampaignService</serviceName>
>>       <methodName>get</methodName>
>>       <operations>0</operations>
>>       <responseTime>241</responseTime>
>>     </ResponseHeader>
>>   </soap:Header>
>>   <soap:Body>
>>     <getResponse xmlns="https://adwords.google.com/api/adwords/cm/v201402
>> ">
>>       <rval>
>>         <totalNumEntries>9</totalNumEntries>
>>         <Page.Type>CampaignPage</Page.Type>
>>         <entries>
>>           <id>162859344</id>
>>           <name>Test Campaign Name</name>
>>         </entries>
>>         <entries>
>>           <id>162859824</id>
>>           <name>Test Campaign Name</name>
>>         </entries>
>>         <entries>
>>           <id>162861144</id>
>>           <name>Test Campaign Name</name>
>>         </entries>
>>         <entries>
>>           <id>162861384</id>
>>           <name>Test Campaign Name</name>
>>         </entries>
>>         <entries>
>>           <id>162861504</id>
>>           <name>Test Campaign Name</name>
>>         </entries>
>>         <entries>
>>           <id>162960744</id>
>>           <name>Test Campaign Name</name>
>>         </entries>
>>         <entries>
>>           <id>162976344</id>
>>           <name>Test Campaign Name</name>
>>         </entries>
>>         <entries>
>>           <id>162976584</id>
>>           <name>Test Campaign Name</name>
>>         </entries>
>>         <entries>
>>           <id>162976704</id>
>>           <name>Test Campaign Name</name>
>>         </entries>
>>       </rval>
>>     </getResponse>
>>   </soap:Body>
>> </soap:Envelope>
>>
>> [Mar 25 2014 17:16:30.000000 - ERROR] POST 
>> /api/adwords/cm/v201402/CampaignService?access_token=*** HTTP/1.1
>> Host: adwords.google.com
>> Connection: Keep-Alive
>> User-Agent: PHP-SOAP/5.4.3
>> Content-Type: text/xml; charset=utf-8
>> SOAPAction: ""
>> Content-Length: 1663
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <SOAP-ENV:Envelope xmlns:SOAP-ENV="
>> http://schemas.xmlsoap.org/soap/envelope/"; xmlns:ns1="
>> https://adwords.google.com/api/adwords/cm/v201402"; xmlns:xsi="
>> http://www.w3.org/2001/XMLSchema-instance";>
>>   <SOAP-ENV:Header>
>>     <ns1:RequestHeader>
>>       <ns1:clientCustomerId>***</ns1:clientCustomerId>
>>       <ns1:developerToken>***</ns1:developerToken>
>>       <ns1:userAgent>*** (AwApi-PHP/5.2.1, Common-PHP/5.2.1, 
>> PHP/5.4.3)</ns1:userAgent>
>>     </ns1:RequestHeader>
>>   </SOAP-ENV:Header>
>>   <SOAP-ENV:Body>
>>     <ns1:mutate>
>>       <ns1:operations>
>>         <ns1:operator>SET</ns1:operator>
>>         <ns1:operand>
>>           <ns1:id>162859344</ns1:id>
>>           <ns1:name>Test Campaign Name</ns1:name>
>>           <ns1:status>ACTIVE</ns1:status>
>>           <ns1:budget>
>>             <ns1:budgetId>236399064</ns1:budgetId>
>>           </ns1:budget>
>>           
>> <ns1:adServingOptimizationStatus>CONVERSION_OPTIMIZE</ns1:adServingOptimizationStatus>
>>           <ns1:settings xsi:type="ns1:KeywordMatchSetting">
>>             <ns1:optIn>true</ns1:optIn>
>>           </ns1:settings>
>>           <ns1:settings xsi:type="ns1:GeoTargetTypeSetting">
>>             
>> <ns1:positiveGeoTargetType>DONT_CARE</ns1:positiveGeoTargetType>
>>             
>> <ns1:negativeGeoTargetType>DONT_CARE</ns1:negativeGeoTargetType>
>>           </ns1:settings>
>>           <ns1:advertisingChannelType>SEARCH</ns1:advertisingChannelType>
>>           <ns1:networkSetting>
>>             <ns1:targetGoogleSearch>true</ns1:targetGoogleSearch>
>>             <ns1:targetSearchNetwork>false</ns1:targetSearchNetwork>
>>             <ns1:targetContentNetwork>false</ns1:targetContentNetwork>
>>           </ns1:networkSetting>
>>           <ns1:biddingStrategyConfiguration>
>>             <ns1:biddingStrategyType>MANUAL_CPC</ns1:biddingStrategyType>
>>           </ns1:biddingStrategyConfiguration>
>>         </ns1:operand>
>>       </ns1:operations>
>>     </ns1:mutate>
>>   </SOAP-ENV:Body>
>> </SOAP-ENV:Envelope>
>>
>> HTTP/1.1 500 Internal Server Error
>> Content-Type: text/xml; charset=UTF-8
>> Date: Tue, 25 Mar 2014 21:16:28 GMT
>> Expires: Tue, 25 Mar 2014 21:16:28 GMT
>> Cache-Control: private, max-age=0
>> X-Content-Type-Options: nosniff
>> X-Frame-Options: SAMEORIGIN
>> X-XSS-Protection: 1; mode=block
>> Server: GSE
>> Transfer-Encoding: chunked
>>
>> <?xml version="1.0"?>
>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
>>   <soap:Header>
>>     <ResponseHeader xmlns="
>> https://adwords.google.com/api/adwords/cm/v201402";>
>>       <requestId>0004f574dd7e60480ae681c500004350</requestId>
>>       <serviceName>CampaignService</serviceName>
>>       <methodName>mutate</methodName>
>>       <operations>0</operations>
>>       <responseTime>242</responseTime>
>>     </ResponseHeader>
>>   </soap:Header>
>>   <soap:Body>
>>     <soap:Fault>
>>       <faultcode>soap:Server</faultcode>
>>       <faultstring>[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ 
>> com.google.ads.api.services.common.error.InternalApiError.&lt;init&gt;(InternalApiErro]</faultstring>
>>       <detail>
>>         <ApiExceptionFault xmlns="
>> https://adwords.google.com/api/adwords/cm/v201402";>
>>           <message>[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ 
>> com.google.ads.api.services.common.error.InternalApiError.&lt;init&gt;(InternalApiErro]</message>
>>           
>> <ApplicationException.Type>ApiException</ApplicationException.Type>
>>           <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
>> xsi:type="InternalApiError">
>>             <fieldPath/>
>>             <trigger/>
>>             
>> <errorString>InternalApiError.UNEXPECTED_INTERNAL_API_ERROR</errorString>
>>             <ApiError.Type>InternalApiError</ApiError.Type>
>>             <reason>UNEXPECTED_INTERNAL_API_ERROR</reason>
>>           </errors>
>>         </ApiExceptionFault>
>>       </detail>
>>     </soap:Fault>
>>   </soap:Body>
>> </soap:Envelope>
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to