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
);
}