Cannot create new account via API: Exception SoapFault exception: [soap:Server] [ManagedCustomerServiceError.NOT_AUTHORIZED @ operations[0]]

81 views
Skip to first unread message

starrychloe S.

unread,
Aug 16, 2016, 7:03:49 PM8/16/16
to AdWords API Forum

Our API is trying to create a new account. This has worked before with another project/master account. The manager account id was given, yet it gave a NOT_AUTHORIZED error. 


297 <190>1 2016-08-16T06:38:50.590915+00:00 app worker.1 - - Exception SoapFault exception: [soap:Server] [ManagedCustomerServiceError.NOT_AUTHORIZED @ operations[0]] in /app/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php:216 
109 <190>1 2016-08-16T06:38:50.590929+00:00 app worker.1 - - Stack trace: 
253 <190>1 2016-08-16T06:38:50.590930+00:00 app worker.1 - - #0 /app/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php(216): SoapClient->__soapCall('mutate', Array, NULL, Array, Array) 
240 <190>1 2016-08-16T06:38:50.590932+00:00 app worker.1 - - #1 /app/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Lib/AdWordsSoapClient.php(86): AdsSoapClient->__soapCall('mutate', Array) 
255 <190>1 2016-08-16T06:38:50.590932+00:00 app worker.1 - - #2 /app/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/v201605/ManagedCustomerService.php(4608): AdWordsSoapClient->__soapCall('mutate', Array) 
174 <190>1 2016-08-16T06:38:50.590933+00:00 app worker.1 - - #3 /app/models/GoogleAdWords.php(1460): ManagedCustomerService->mutate(Array) 

I can list accounts fine. 

$ YII_ENV=prod yii kw/list-accounts
4342976991, BestSales, manage?: 1, test?:
5336143149, BestSales 1, manage?: , test?:

 This is what I see in the AdWords web interface.


I don't even see a button to create an account in the AdWords web interface either. When I try to create an account, I'm using the account number with dashes, but I don't think that should matter because it works for fetching account numbers. Do you want to see the code which tries to create the account? The version of API I'm using is v201605.

Anthony Madrigal

unread,
Aug 16, 2016, 8:15:54 PM8/16/16
to AdWords API Forum
Hello,

That seems pretty odd that you are not seeing the create account button in the UI as well. Could you please provide me with the SOAP request and response where you are getting this error so that I can further investigate? Please do so using reply privately to author.

Thanks,
Anthony
AdWords API Team

starrychloe S.

unread,
Aug 18, 2016, 12:25:15 PM8/18/16
to AdWords API Forum
It was because it was a linked account and the account owner had the email address used to log in set to standard access. When they changed it to admin access, then the new account button was available and the API worked. 

I thought all the account numbers were the same, regardless of the email address/Google account used to log in? How does it know the email address anyways? It's not part of the authentication. I don't remember which login the refresh token came from.

Anthony Madrigal

unread,
Aug 18, 2016, 7:43:17 PM8/18/16
to AdWords API Forum
Hi,

I'm glad you were able to figure what the issue was. Refresh tokens are generated from a login, so if the email address has read only access, then they will not be able to create an account.

Please let me know if there is anything else I can help with.

Cheers,
Anthony
AdWords API Team
Reply all
Reply to author
Forward
0 new messages