Can't add new acount with php examples (ManagedCustomerServiceError.NOT_AUTHORIZED)

88 views
Skip to first unread message

Сергей Паутов

unread,
May 22, 2018, 7:34:35 AM5/22/18
to AdWords API and Google Ads API Forum
Hello,

My request is:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Header>
<ns2:RequestHeader>
<ns1:clientCustomerId>XXX-XXX-XXXX</ns1:clientCustomerId>
<ns1:developerToken>XXXXXXXXXXXXXXXXXX-XXX</ns1:developerToken>
<ns1:userAgent>unknown (AwApi-PHP, googleads-php-lib/34.0.0, PHP/7.2.5-1+ubuntu16.04.1+deb.sury.org+1)</ns1:userAgent>
<ns1:validateOnly>false</ns1:validateOnly>
<ns1:partialFailure>false</ns1:partialFailure>
</ns2:RequestHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns2:mutate>
<ns2:operations>
<ns1:operator>ADD</ns1:operator>
<ns2:operand>
<ns2:name>New Account #5b03f9bc020be</ns2:name>
<ns2:currencyCode>EUR</ns2:currencyCode>
<ns2:dateTimeZone>Europe/London</ns2:dateTimeZone>
</ns2:operand>
<ns2:inviteeEmail>XXX...@XXXXX.com</ns2:inviteeEmail>
<ns2:inviteeRole>READ_ONLY</ns2:inviteeRole>
</ns2:operations>
</ns2:mutate>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response is:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<requestId>00056cc9785843b10a1b58d1830ef2bd</requestId>
<serviceName>ManagedCustomerService</serviceName>
<methodName>mutate</methodName>
<operations>1</operations>
<responseTime>235</responseTime>
</ns2:ResponseHeader>
</soap:Header>
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>[ManagedCustomerServiceError.NOT_AUTHORIZED @ operations[0]]</faultstring>
<detail>
<message>[ManagedCustomerServiceError.NOT_AUTHORIZED @ operations[0]]</message>
<ApplicationException.Type>ApiException</ApplicationException.Type>
<errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:ManagedCustomerServiceError">
<fieldPath>operations[0]</fieldPath>
<fieldPathElements>
<field>operations</field>
<index>0</index>
</fieldPathElements>
<trigger></trigger>
<errorString>ManagedCustomerServiceError.NOT_AUTHORIZED</errorString>
<ApiError.Type>ManagedCustomerServiceError</ApiError.Type>
<ns2:reason>NOT_AUTHORIZED</ns2:reason>
</errors>
</ns2:ApiExceptionFault>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>

Please help.

Teja Makani

unread,
May 22, 2018, 3:55:39 PM5/22/18
to AdWords API and Google Ads API Forum
Hello Sergey,

The 
NOT_AUTHORIZED error occurs when the user authenticating the request is not authorized to perform this operation. Only users with Administrative access can accept and reject manager account link requests. Could you check the access level of the email address used to generate the refresh token? If you still encounter the error with an administrative access, please share the developer token and client customer id along with the email address used to generate the refresh token and I'll take a look. Please use reply privately to the author to share the details. 

Regards,
Sai Teja, AdWords API Team.

Teja Makani

unread,
May 22, 2018, 4:46:05 PM5/22/18
to AdWords API and Google Ads API Forum
Hello Sergey,

Please note the correction to my previous response below: 

From your logs, I can see that you are trying to add a new client account under the Manager account. For that, you will need to verify that the user making this API call has Administrative access to the Manager account. If the user authorizing the API call doesn't have Administrative access, you are likely to see the NOT_AUTHORIZED error. If that is the case, you could either ask the Admin on the account to upgrade the access level of the API user or use the credentials of a user with the required access level to make the API call. If you still encounter the error with an administrative access, please share the client customer id along with the email address used to generate the refresh token and I'll take a look. Please use reply privately to the author to share the details. 

Nadine Sundquist (AdWords API Team)

unread,
May 24, 2018, 8:00:23 PM5/24/18
to AdWords API and Google Ads API Forum
Hello Everyone of the Community,

I'm just following up here in case anyone bumps into this. We took this offline and figured this out. If you hit this error, it means that you may be trying to use a whitelisted feature. The inviteeEmail field currently has a small note on it saying that it is whitelisted, so if you attempt to use it, you'll get this error back. Hopefully, this saves someone some time a little later on.

Cheers,
Nadine, AdWords API Team

Сергей Паутов

unread,
May 25, 2018, 7:02:47 AM5/25/18
to AdWords API and Google Ads API Forum
Hello Nadine,

Ok, another question is - How I can add user|email to whitelist from Adwords API?

пятница, 25 мая 2018 г., 3:00:23 UTC+3 пользователь Nadine Sundquist (AdWords API Team) написал:

Nadine Sundquist (AdWords API Team)

unread,
May 29, 2018, 9:38:35 AM5/29/18
to AdWords API and Google Ads API Forum
Hello,

My apologies for the delay. We've just come back from a holiday weekend in the US. This is one of those cases where you would need to already have an account manager here at Google. If you have an account manager, then you would ask that account manager to request if you could be added to the whitelist. A few of these features are quite new and aren't meant to be used by everyone, yet. If we find over time by working with these account manager and these few whitelisted people that things are working well, then we often do roll it out to everyone. When we do roll it out, we announce it on our blog or in a release.

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