Frank,

Thanks for the detailed feedback!  At this point, I'll have to guess that 
the refresh token you are using doesn't belong to the MCC user.  Please 
regenerate a refresh token - when you are authorizing the access, please 
make sure you are logged in as the owner of the MCC account.

Please let me know if that helps,

Ray,

On Friday, March 7, 2014 8:33:02 AM UTC-5, Frank Tolsma wrote:
>
> Ray,
>
> Yes, I am using the Java library.
>
> I thought about using setClientCustomerId(). I think you have to remove 
> the '-' from the xxx-xxx-xxxx id, but I tried with and without '-', of 
> course. But no luck.
>
> The I looked for an example that would do the initial part of what I need 
> to do: iterate over the customer accounts. The 
> adwords.axis.v201309.accountmanagement.GetAccountHierarchy example does 
> that. And it uses the ManagedCustomerServiceInterface, as you suggested. 
> But I get the same NOT_ADS_USER error.
>
> I don't know where exactly, because the debugger won't let me step through 
> the source code for some reason (I hate these environments where a million 
> things can be configured the wrong way), but the logging shows me the 
> following:
>
> [07 mrt 2014 14:11:20,961-requestInfoLogger:INFO:main] Request made: 
> Service: "*ManagedCustomerServiceInterfacePort*" Method: "get" URL: "
> https://adwords.google.com/api/adwords/mcm/v201309/
> *ManagedCustomerService*"
> [07 mrt 2014 14:11:21,038-soapXmlLogger:WARN:main] SOAP Request:
> <?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/mcm/v201309"; 
> soapenv:mustUnderstand="0">
>             <ns2:clientCustomerId xmlns:ns2="
> https://adwords.google.com/api/adwords/cm/v201309";>*MCC account id*
> </ns2:clientCustomerId>
>             <ns3:developerToken xmlns:ns3="
> https://adwords.google.com/api/adwords/cm/v201309";>*myDeveloperToken*
> </ns3:developerToken>
>             <ns4:userAgent xmlns:ns4="
> https://adwords.google.com/api/adwords/cm/v201309";>*Test* (AwApi-Java, 
> AdWords-Axis/1.24.0, Common-Java/1.24.0, Axis/1.4, Java/1.7.0_51, 
> maven)</ns4:userAgent>
>             <ns5:validateOnly xmlns:ns5="
> https://adwords.google.com/api/adwords/cm/v201309
> ">false</ns5:validateOnly>
>             <ns6:partialFailure xmlns:ns6="
> https://adwords.google.com/api/adwords/cm/v201309
> ">false</ns6:partialFailure>
>         </ns1:RequestHeader>
>     </soapenv:Header>
>     <soapenv:Body>
>         <get xmlns="https://adwords.google.com/api/adwords/mcm/v201309";>
>             <serviceSelector>
>                 <ns7:fields xmlns:ns7="
> https://adwords.google.com/api/adwords/cm/v201309";>Login</ns7:fields>
>                 <ns8:fields xmlns:ns8="
> https://adwords.google.com/api/adwords/cm/v201309";>CustomerId</ns8:fields>
>                 <ns9:fields xmlns:ns9="
> https://adwords.google.com/api/adwords/cm/v201309";>Name</ns9:fields>
>             </serviceSelector>
>         </get>
>     </soapenv:Body>
> </soapenv:Envelope>
>
> [07 mrt 2014 14:11:21,117-soapXmlLogger:WARN:main] SOAP Response:
> <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="
> http://schemas.xmlsoap.org/soap/envelope/";>
>     <soap:Header>
>         <ResponseHeader xmlns:ns2="
> https://adwords.google.com/api/adwords/cm/v201309"; xmlns="
> https://adwords.google.com/api/adwords/mcm/v201309";>
>             <ns2:requestId>0004f40400141fc00adb052a00003b83</ns2:requestId>
>             <ns2:serviceName>ManagedCustomerService</ns2:serviceName>
>             <ns2:methodName>get</ns2:methodName>
>             <ns2:operations>0</ns2:operations>
>             <ns2:responseTime>166</ns2:responseTime>
>         </ResponseHeader>
>     </soap:Header>
>     <soap:Body>
>         <soap:Fault>
>             <faultcode>soap:Server</faultcode>
>             <faultstring>[AuthenticationError.NOT_ADS_USER @ ; 
> trigger:'&lt;null&gt;']</faultstring>
>             <detail>
>                 <ApiExceptionFault xmlns="
> https://adwords.google.com/api/adwords/mcm/v201309"; xmlns:ns2="
> https://adwords.google.com/api/adwords/cm/v201309";>
>                     <ns2:message>[*AuthenticationError.NOT_ADS_USER* @ ; 
> trigger:'&lt;null&gt;']</ns2:message>
>                     
> <ns2:ApplicationException.Type>ApiException</ns2:ApplicationException.Type>
>                     <ns2:errors xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:type="ns2:AuthenticationError">
>                         <ns2:fieldPath/>
>                         <ns2:trigger>&lt;null&gt;</ns2:trigger>
>                         
> <ns2:errorString>AuthenticationError.NOT_ADS_USER</ns2:errorString>
>                         
> <ns2:ApiError.Type>AuthenticationError</ns2:ApiError.Type>
>                         <ns2:reason>NOT_ADS_USER</ns2:reason>
>                     </ns2:errors>
>                 </ApiExceptionFault>
>             </detail>
>         </soap:Fault>
>     </soap:Body>
> </soap:Envelope>
>
> Exception in thread "main" AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
>  faultSubcode: 
>  faultString: [AuthenticationError.NOT_ADS_USER @ ; trigger:'&lt;null&gt;']
>  faultActor: 
>  faultNode: 
>  faultDetail: 
>     
> {https://adwords.google.com/api/adwords/mcm/v201309}ApiExceptionFault:<ns2:message>[AuthenticationError.NOT_ADS_USER
>  
> @ ; 
> trigger:'&lt;null&gt;']</ns2:message><ns2:ApplicationException.Type>ApiException</ns2:ApplicationException.Type><ns2:errors
>  
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:type="ns2:AuthenticationError"><ns2:fieldPath/><ns2:trigger>&lt;null&gt;</ns2:trigger><ns2:errorString>AuthenticationError.NOT_ADS_USER</ns2:errorString><ns2:ApiError.Type>AuthenticationError</ns2:ApiError.Type><ns2:reason>NOT_ADS_USER</ns2:reason></ns2:errors>
>
> [*AuthenticationError.NOT_ADS_USER* @ ; trigger:'<null>']
>
> It looks like: 
> ManagedCustomerPage page = managedCustomerService.get(selector); 
> is where the error happens.
> So it is not even asking to get info about a specific customer account 
> yet, but only trying to get a list of customer accounts...
>
> So maybe the MCC refreshToken is wrong? The thing is: I did not generate 
> that token. I had the person who owns the MCC account do it for me.
> But I can successfully execute the following, so I think that means the 
> MCC account info and the refreshToken are ok.
>
>             Credential oAuth2Credential = new OfflineCredentials.Builder()
>                 .forApi(Api.ADWORDS)
>                 .fromFile()
>                 .build()
>                 .generateCredential();
>
>             // Construct an AdWordsSession.
>             AdWordsSession session = new AdWordsSession.Builder()
>                 .fromFile()
>                 .withOAuth2Credential(oAuth2Credential)
>                 .build();
>
>
> thanks,
> Frank
>
>
>
>
>
> Op vrijdag 7 maart 2014 00:08:56 UTC+1 schreef Ray Tsang (AdWords API 
> Team):
>>
>> Frank,
>>
>> Jake is right - there is a way to specify the CID.  It sounds like you 
>> are using Java client library - what you can do is using 
>> AdWordsSession.setClientCustomerId()<http://googleads.github.io/googleads-java-lib/1.26.0/com/google/api/ads/adwords/lib/client/AdWordsSession.html#setClientCustomerId(java.lang.String)>
>>  method.
>>
>> You can use the 
>> ManagedCustomerService<https://developers.google.com/adwords/api/docs/reference/v201402/ManagedCustomerService>to
>>  get all of your descendant AdWords accounts under the MCC.
>>
>> Thanks,
>>
>> Ray
>>
>> On Thursday, March 6, 2014 4:37:16 PM UTC-5, Jake Wilson wrote:
>>>
>>> I'm not sure exactly which library you are using but for example, when 
>>> I'm using the PHP library, you have to specify which Account ID you want to 
>>> fetch campaigns for like this:
>>>
>>> $user = new AdWordsUser();
>>> $user->setClientCustomerId(39495930303);  <--- Account ID
>>>
>>> You have to get the account IDs via the API.  They don't show up in the 
>>> web interface that I have seen.
>>>
>>> Jake
>>>
>>>
>>> On Thursday, March 6, 2014 10:12:10 AM UTC-7, Frank Tolsma wrote:
>>>>
>>>> Ray,
>>>>
>>>> So the MCC info should be in the ads.properties file and then I should 
>>>> be able to iterate through the accounts managed by the MCC account (and 
>>>> get 
>>>> reports from those regular accounts) ?
>>>>
>>>> Is the GetAccountHierarchy example an example of how this iterating 
>>>> could be done?
>>>> When I run that example, I also get a AuthenticationError.NOT_ADS_USER 
>>>> error.
>>>>
>>>> That then probably means that my MCC account info is wrong?
>>>>
>>>> thanks,
>>>> Frank
>>>>
>>>> Op woensdag 5 maart 2014 20:06:45 UTC+1 schreef Ray Tsang (AdWords API 
>>>> Team):
>>>>>
>>>>> Frank,
>>>>>
>>>>> You can only pull campaign data when you have specified a regular 
>>>>> AdWords (non-MCC) account.  You'll need to iterate through different CIDs 
>>>>> to pull data for each account.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Ray
>>>>>
>>>>> On Wednesday, March 5, 2014 9:30:36 AM UTC-5, Frank Tolsma wrote:
>>>>>>
>>>>>> Going through the OAuth2 steps, I generated a refreshToken and put 
>>>>>> that in ads.properties.
>>>>>> That was for a 'normal' account, one that is managed by/from the MCC 
>>>>>> account.
>>>>>> Running GetCampaigns worked.
>>>>>>
>>>>>> Then I did the same for the MCC account, because I need all 
>>>>>> campaigns, for all customers.
>>>>>> But that resulted in an autentication error: 
>>>>>> AuthenticationError.NOT_ADS_USER
>>>>>> I don't know why though...
>>>>>>
>>>>>> I put the response I got below. The requestId is of no use to me, but 
>>>>>> maybe it can be to you?
>>>>>>
>>>>>>
>>>>>> [05 mrt 2014 15:19:40,736-soapXmlLogger:WARN:main] 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/v201309";>
>>>>>>             <requestId>*0004f3dcb8be13f00ae0d00300003947*</requestId>
>>>>>>             <serviceName>CampaignService</serviceName>
>>>>>>             <methodName>get</methodName>
>>>>>>             <operations>0</operations>
>>>>>>             <responseTime>118</responseTime>
>>>>>>         </ResponseHeader>
>>>>>>     </soap:Header>
>>>>>>     <soap:Body>
>>>>>>         <soap:Fault>
>>>>>>             <faultcode>soap:Server</faultcode>
>>>>>>             <faultstring>[AuthenticationError.NOT_ADS_USER @ ; 
>>>>>> trigger:'&lt;null&gt;']</faultstring>
>>>>>>             <detail>
>>>>>>                 <ApiExceptionFault xmlns="
>>>>>> https://adwords.google.com/api/adwords/cm/v201309";>
>>>>>>                     <message>[AuthenticationError.NOT_ADS_USER @ ; 
>>>>>> trigger:'&lt;null&gt;']</message>
>>>>>>                     
>>>>>> <ApplicationException.Type>ApiException</ApplicationException.Type>
>>>>>>                     <errors xmlns:xsi="
>>>>>> http://www.w3.org/2001/XMLSchema-instance"; 
>>>>>> xsi:type="AuthenticationError">
>>>>>>                         <fieldPath/>
>>>>>>                         <trigger>&lt;null&gt;</trigger>
>>>>>>                         
>>>>>> <errorString>AuthenticationError.NOT_ADS_USER</errorString>
>>>>>>                         
>>>>>> <ApiError.Type>AuthenticationError</ApiError.Type>
>>>>>>                         <reason>NOT_ADS_USER</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 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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to