Teja, thanks for your help. It's solved now. In case it's useful for 
someone else, there were two different issues:

1. Yesterday I was in fact logged in to my test manager account when I 
created the test client accounts (red label displayed, as in attachment), 
so I am certain I was creating them correctly and still they did not show 
up in the "Accounts" menu, only in "Overview", and even in "Overview" I 
could not link them to the test manager account, instead I kept getting the 
message "You can't link this account because it's already linked to another 
manager in this account hierarchy." However, I simply tried again today 
(same test manager, same previously created test client accounts, same 
menu) and this time they were linked successfully... It's either a bug or 
there's a set waiting time for linking test accounts.

2. It turns out I that my OAuth credentials were for my production manager 
account, as I got them while logged in with it, but in fact I needed OAuth 
credentials for my *test* manager account, so I got a client ID / secret 
for the latter and it worked! The documentation says "While logged in with 
your manager account credentials, open the Google API Console Credentials 
page." In the interest of clarity, this should read "with your *test *manager 
account credentials."

Thanks again!

On Friday, September 7, 2018 at 4:26:57 PM UTC-3, Teja Makani wrote:
>
> Hello Ivan,
>
> You are right, the AuthorizationError.USER_PERMISSION_DENIED 
> <https://developers.google.com/adwords/api/docs/common-errors#AuthorizationError.USER_PERMISSION_DENIED>
>  occurs 
> when there is no link between the manager account authenticated in the 
> request and the client account specified in the headers. 
>
> While logged into AdWords as your test manager account, any client 
> accounts you create will automatically be test accounts under that manager 
> only. If you don't see the test accounts under your test MCC account, It 
> could be possible that while creating test accounts you might login as 
> another MCC account user. So, as a precaution you could use incognito 
> window of browser and login with your test MCC account to create test 
> client accounts 
> <https://developers.google.com/adwords/api/docs/guides/first-api-call#create_test_accounts>.
>  
> If you don't want to create new accounts then you can un link the accounts 
> <https://support.google.com/google-ads/answer/7456531> under that another 
> manager account and link them  
> <https://support.google.com/google-ads/answer/7456530>to your manager 
> account. Alternatively you can link and un link accounts via API using 
> managedCustomerService.mutateLink 
> <https://developers.google.com/adwords/api/docs/reference/v201806/ManagedCustomerService#mutatelink>
>  service, 
> you could refer this guide 
> <https://developers.google.com/adwords/api/docs/guides/accounts-overview#managedcustomerservice>
>  for 
> more details. Also, you could fetch the list of accounts linked to your 
> manager account by using managedCustomerService.get  
> <https://developers.google.com/adwords/api/docs/reference/v201806/ManagedCustomerService#get>
> operation.
>
> If you are still facing issues, please share the MCC Id's of test manager 
> accounts and CID's of test client accounts, you could use *reply 
> privately to author* option while sharing the details.
>
> Regards,
> Sai Teja, AdWords API Team.
>
> On Friday, September 7, 2018 at 5:17:02 AM UTC-4, Ivan wrote:
>>
>> Hello! 
>>
>> I am trying to make my first API call, so I set up a test manager account 
>> and a few test client accounts (i.e. the dummy accounts created under the 
>> test manager account). But when running generate_refresh_token.py, I 
>> received this:
>>
>> Error summary: {'faultMessage': 
>> "[AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'<null>']", 
>> 'requestId': '0005753d9c9f13580a3706d12803025d', 'serviceName': 
>> 'CampaignService', 'methodName': 'get', 'operations': '1', 'responseTime': 
>> '86'}
>>
>> This made me realize I hadn't actually linked the test manager account to 
>> the test client accounts. But when I tried to link them to the test manager 
>> account, I received this:
>>
>> "You can't link this account because it's already linked to another 
>> manager in this account hierarchy. If you don't manage this account, please 
>> contact your top manager account to change its manager to this manager." 
>> Please see attachment.
>>
>> As stated in the docs, "While logged in to AdWords as your test manager 
>> account, any client accounts you create will automatically be test 
>> accounts.", so I find it hard to understand that "it's already linked to 
>> another manager in this account hierarchy". These are test accounts created 
>> under a test manager.
>>
>> As a side note, I am also having the same minor error described in the 
>> links below, namely that test client accounts are not showing where they 
>> should. While not fatal, this minor error might be related (or not)
>>
>>
>> https://groups.google.com/forum/#!searchin/adwords-api/client$20accounts|sort:date/adwords-api/uNk-uBn9VWo/08VTuEi6BAAJ
>>
>>
>> https://www.en.advertisercommunity.com/t5/Google-Ads-Account-Issues/New-Client-Accounts-Create-As-Cancelled/td-p/1779481
>>
>> Thanks in advance!
>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/1dd23680-3845-4085-805c-8a16ef5e1b30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to