Hi All,
I messed up something when I moved to Oath2 vs the old email/password syle.
I pass the ClientCustomerId dynamically (we manage a lot of accounts).
It all works find on account level tests (like your
GetAccountHierarchy.java exemple), but fails when I get lower level:
This is how I connect (with properties file and a fresh ClientCustomerId )
Credential oAuth2Credential = new OfflineCredentials.Builder()
.forApi(OfflineCredentials.Api.ADWORDS)
.fromFile()
.build()
.generateCredential();
// Construct an AdWordsSession.
this.session = new
AdWordsSession.Builder().withClientCustomerId(account_id)
.fromFile()
.withOAuth2Credential(oAuth2Credential)
.build();
This is what I get back on all campaign or lower level ops:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<ns1:RequestHeader
xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201302"
soapenv:mustUnderstand="0">
<ns1:developerToken>XXXXXXXXXXXXXXXXX</ns1:developerToken>
<ns1:userAgent>XXXXXXXXX</ns1:userAgent>
<ns1:validateOnly>false</ns1:validateOnly>
<ns1:partialFailure>false</ns1:partialFailure>
</ns1:RequestHeader>
</soapenv:Header>
<soapenv:Body>
<mutate xmlns="https://adwords.google.com/api/adwords/cm/v201302">
<operations>
<operator>SET</operator>
<operand
xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201302"
xsi:type="ns2:BiddableAdGroupCriterion">
<ns2:adGroupId>1147577017</ns2:adGroupId>
<ns2:criterion>
<ns2:id>13954853677</ns2:id>
</ns2:criterion>
<ns2:userStatus>PAUSED</ns2:userStatus>
</operand>
</operations>
</mutate>
</soapenv:Body>
</soapenv:Envelope>
[25 Oct 2013 13:13:26,422-soapXmlLogger:WARN:pool-36-thread-2] SOAP
Response:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ResponseHeader
xmlns="https://adwords.google.com/api/adwords/cm/v201302">
<requestId>0004e996621940d80a42e948000077ff</requestId>
<serviceName>AdGroupCriterionService</serviceName>
<methodName>mutate</methodName>
<operations>0</operations>
<responseTime>446</responseTime>
<units>0</units>
</ResponseHeader>
</soap:Header>
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>[EntityNotFound.INVALID_ID @
operations[0].operand.adGroupId; trigger:'AdGroupId:
1147577017']</faultstring>
<detail>
<ApiExceptionFault
xmlns="https://adwords.google.com/api/adwords/cm/v201302">
<message>[EntityNotFound.INVALID_ID @
operations[0].operand.adGroupId; trigger:'AdGroupId: 1147577017']</message>
<ApplicationException.Type>ApiException</ApplicationException.Type>
<errors
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="EntityNotFound">
<fieldPath>operations[0].operand.adGroupId</fieldPath>
<trigger>AdGroupId: 1147577017</trigger>
<errorString>EntityNotFound.INVALID_ID</errorString>
<ApiError.Type>EntityNotFound</ApiError.Type>
<reason>INVALID_ID</reason>
</errors>
</ApiExceptionFault>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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/groups/opt_out.