Hide and Unhide Customer in MCC

59 views
Skip to first unread message

Fred Lovine

unread,
Jan 12, 2022, 8:56:35 AM1/12/22
to Google Ads API and AdWords API Forum
Hi,

We are receiving an error when trying to hide / unhide a customer account in our MCC. It's not clear if the problem is with our code, or with the API.

Here is the error:
Google\ApiCore\ApiException : {
    "message": "Request contains an invalid argument.",
    "code": 3,
    "status": "INVALID_ARGUMENT",
    "details": [
        {
            "@type": 0,
            "data": "type.googleapis.com\/google.ads.googleads.v8.errors.GoogleAdsFailure"
        },
        {
            "@type": 0,
            "data": [
                {
                    "errorCode": {
                        "managerLinkError": "INVALID_CHANGE"
                    },
                    "message": "The change for mutate link is invalid.",
                    "location": {
                        "fieldPathElements": [
                            {
                                "fieldName": "operation"
                            }
                        ]
                    }
                }
            ]
        },
        {
            "@type": 0,
            "data": "X8YUUXFTJaeUFnYsAY_6sw"
        }
    ]
}

Here is the php code (using Google Ads php client library):
public function hideUnhideAccount(bool $hide )
{
$origCustomerClientLink = $this->getCustomerClientLink();

$customerClientLink = new CustomerClientLink();
$customerClientLink->setResourceName($origCustomerClientLink->getResourceName());
$customerClientLink->setHidden($hide);

$customerClientLinkOperation = new CustomerClientLinkOperation();
$customerClientLinkOperation->setUpdate($customerClientLink);
$customerClientLinkOperation->setUpdateMask(FieldMasks::allSetFieldsOf($customerClientLink));

$customerClientLinkServiceClient = $this->client->getCustomerClientLinkServiceClient();
$customerClientLinkServiceClient->mutateCustomerClientLink(
$this->managerCustomerId,
$customerClientLinkOperation
);

}

Fred Lovine

unread,
Jan 12, 2022, 12:50:46 PM1/12/22
to Google Ads API and AdWords API Forum
It appears this operation works for Admin level users, but fails for Standard level. It would be helpful if the error message conveyed this.

Google Ads API Forum Advisor

unread,
Jan 12, 2022, 3:59:42 PM1/12/22
to fr...@99calls.com, adwor...@googlegroups.com
Hi Fred,

Thanks for reaching out. I will relay your suggestion for more descriptive error messaging here. The Ads API follows the same user access privileges laid out here.

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2UjF5E:ref
Reply all
Reply to author
Forward
0 new messages