Extend an invitation to link an account with our MCC account (NOT AUTHORIZED ERROR)

90 views
Skip to first unread message

fe...@dashbo.io

unread,
Mar 15, 2019, 2:15:28 PM3/15/19
to AdWords API and Google Ads API Forum
Hi, I'm trying to extend an invitation to link an account with our MCC account using the mutateLink operation, and I'm trying to do this using the google-ads-python-lib library.

When I try to send the invitation, I get an error ManagedCustomerServiceError.NOT_AUTHORIZED.

We have admin access to MCC.

The request I'm sending looks like this (I will delete the developer token and the credentials of the accounts envolved):

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
    <soap-env:Header>
        <ns0:RequestHeader xmlns:ns0="https://adwords.google.com/api/adwords/mcm/v201809">
            <ns1:developerToken xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809">********
            </ns1:developerToken>
            <ns2:userAgent xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809">Dashbo (AwApi-Python,
                googleads/15.0.2, Python/3.6.3, zeep)
            </ns2:userAgent>
            <ns3:validateOnly xmlns:ns3="https://adwords.google.com/api/adwords/cm/v201809">false</ns3:validateOnly>
            <ns4:partialFailure xmlns:ns4="https://adwords.google.com/api/adwords/cm/v201809">false</ns4:partialFailure>
        </ns0:RequestHeader>
    </soap-env:Header>
    <soap-env:Body>
        <ns0:mutateLink xmlns:ns0="https://adwords.google.com/api/adwords/mcm/v201809">
            <ns0:operations>
                <ns1:operator xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809">ADD</ns1:operator>
                <ns0:operand>
                    <ns0:managerCustomerId>**********</ns0:managerCustomerId>
                    <ns0:clientCustomerId>**********</ns0:clientCustomerId>
                    <ns0:linkStatus>PENDING</ns0:linkStatus>
                </ns0:operand>
            </ns0:operations>
        </ns0:mutateLink>
    </soap-env:Body>
</soap-env:Envelope>

And this is the response I'm receiving:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
    <ResponseHeader xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809"
                    xmlns="https://adwords.google.com/api/adwords/mcm/v201809">
        <ns2:requestId>00058414095e34100aa33dc4c00f6f46</ns2:requestId>
        <ns2:serviceName>ManagedCustomerService</ns2:serviceName>
        <ns2:methodName>mutateLink</ns2:methodName>
        <ns2:operations>1</ns2:operations>
        <ns2:responseTime>243</ns2:responseTime>
    </ResponseHeader>
</soap:Header>
<soap:Body>
    <soap:Fault>
        <faultcode>soap:Server</faultcode>
        <faultstring>[ManagedCustomerServiceError.NOT_AUTHORIZED @ operations[0]]</faultstring>
        <detail>
            <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/mcm/v201809"
                               xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809">
                <ns2:message>[ManagedCustomerServiceError.NOT_AUTHORIZED @ operations[0]]</ns2:message>
                <ns2:ApplicationException.Type>ApiException</ns2:ApplicationException.Type>
                <ns2:errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                            xsi:type="ManagedCustomerServiceError">
                    <ns2:fieldPath>operations[0]</ns2:fieldPath>
                    <ns2:fieldPathElements>
                        <ns2:field>operations</ns2:field>
                        <ns2:index>0</ns2:index>
                    </ns2:fieldPathElements>
                    <ns2:trigger/>
                    <ns2:errorString>ManagedCustomerServiceError.NOT_AUTHORIZED</ns2:errorString>
                    <ns2:ApiError.Type>ManagedCustomerServiceError</ns2:ApiError.Type>
                    <reason>NOT_AUTHORIZED</reason>
                </ns2:errors>
            </ApiExceptionFault>
        </detail>
    </soap:Fault>
</soap:Body>
</soap:Envelope>

I'm not sure of what's happening. Any help will be appreciated.

Thank you!

googleadsapi...@google.com

unread,
Mar 15, 2019, 5:44:05 PM3/15/19
to AdWords API and Google Ads API Forum
Hello,

While extending the invitation you have use the credentials of the user having access to the manager account. Please make sure the credentials belong to the user of the manager account. If the issue persists, please share the email address of the user using which the OAuth credentials belongs to, the manager account CID and the client account to investigate further. You could use reply privately to the author option while sharing the details requested. 

Regards,
Sai Teja, AdWords API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Reply all
Reply to author
Forward
0 new messages