We are trying to unlink a customer from his manager. The status of the link
is ACTIVE, but when we attempt to set it to INACTIVE, we get an
INVALID_STATUS_CHANGE error. The funny thing is that, if we unlink the
customer manually via the Google Ads UI, then the status is indeed set to
INACTIVE.
Here is the code in question:
final CustomerManagerLinkOperation.Builder managerLinkOp =
CustomerManagerLinkOperation.newBuilder();
managerLinkOp
.getUpdateBuilder()
.setResourceName(
ResourceNames.customerManagerLink(Long.
parseLong(adAccountId),
Long.parseLong(managerId),
managerLinkId))
.setStatus(ManagerLinkStatus.INACTIVE);
managerLinkOp.setUpdateMask(FieldMasks.allSetFieldsOf(
managerLinkOp.getUpdate()));
managerLinkServiceClient = googleAdsCustomerClient
.createCustomerManagerLinkServiceClient();
final MutateCustomerManagerLinkResponse response =
managerLinkServiceClient.mutateCustomerManagerLink(
adAccountId, Arrays.asList(managerLinkOp.build()));
which produces:
2022-09-02T09:38:44.796043+00:00 app[web.1]: INFO: FAILURE REQUEST DETAIL.
2022-09-02T09:38:44.796044+00:00 app[web.1]: Request
2022-09-02T09:38:44.796044+00:00 app[web.1]: -------
2022-09-02T09:38:44.796046+00:00 app[web.1]: MethodName:
google.ads.googleads.v11.services.CustomerManagerLinkService/MutateCustomerManagerLink
2022-09-02T09:38:44.796047+00:00 app[web.1]: Endpoint:
googleads.googleapis.com:443
2022-09-02T09:38:44.796048+00:00 app[web.1]: Headers:
{developer-token=REDACTED, login-customer-id=2094835947,
x-goog-api-client=gl-java/1.8.0_345 gccl/19.0.0 gapic/19.0.0 gax/2.6.1
grpc/1.41.0}
2022-09-02T09:38:44.796049+00:00 app[web.1]: Body: customer_id: "2094835947"
2022-09-02T09:38:44.796049+00:00 app[web.1]: operations {
2022-09-02T09:38:44.796049+00:00 app[web.1]: update {
2022-09-02T09:38:44.796049+00:00 app[web.1]: resource_name:
"customers/2094835947/customerManagerLinks/5839428813~265418785"
2022-09-02T09:38:44.796050+00:00 app[web.1]: status: INACTIVE
2022-09-02T09:38:44.796050+00:00 app[web.1]: }
2022-09-02T09:38:44.796050+00:00 app[web.1]: update_mask {
2022-09-02T09:38:44.796051+00:00 app[web.1]: paths: "resource_name"
2022-09-02T09:38:44.796051+00:00 app[web.1]: paths: "status"
2022-09-02T09:38:44.796051+00:00 app[web.1]: }
2022-09-02T09:38:44.796051+00:00 app[web.1]: }
2022-09-02T09:38:44.796051+00:00 app[web.1]:
2022-09-02T09:38:44.796052+00:00 app[web.1]:
2022-09-02T09:38:44.796052+00:00 app[web.1]: Response
2022-09-02T09:38:44.796052+00:00 app[web.1]: --------
2022-09-02T09:38:44.796059+00:00 app[web.1]: Headers:
Metadata(content-type=application/grpc,request-id=OwJ8Ou_ftfHlOQKlMe1O6Q,date=Fri,
02 Sep 2022 09:38:44 GMT,alt-svc=h3=":443"; ma=2592000,h3-29=":443";
ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443";
ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43")
2022-09-02T09:38:44.796059+00:00 app[web.1]: Body: null
2022-09-02T09:38:44.796059+00:00 app[web.1]: Failure message: errors {
2022-09-02T09:38:44.796059+00:00 app[web.1]: error_code {
2022-09-02T09:38:44.796060+00:00 app[web.1]: manager_link_error:
INVALID_STATUS_CHANGE
2022-09-02T09:38:44.796060+00:00 app[web.1]: }
2022-09-02T09:38:44.796061+00:00 app[web.1]: message: "The changed status
for mutate link is invalid."
2022-09-02T09:38:44.796061+00:00 app[web.1]: location {
2022-09-02T09:38:44.796061+00:00 app[web.1]: field_path_elements {
2022-09-02T09:38:44.796061+00:00 app[web.1]: field_name: "operations"
2022-09-02T09:38:44.796062+00:00 app[web.1]: index: 0
2022-09-02T09:38:44.796062+00:00 app[web.1]: }
2022-09-02T09:38:44.796062+00:00 app[web.1]: }
2022-09-02T09:38:44.796062+00:00 app[web.1]: }
2022-09-02T09:38:44.796063+00:00 app[web.1]: request_id:
"OwJ8Ou_ftfHlOQKlMe1O6Q"
2022-09-02T09:38:44.796063+00:00 app[web.1]:
2022-09-02T09:38:44.796063+00:00 app[web.1]: Status:
Status{code=INVALID_ARGUMENT, description=Request contains an invalid
argument., cause=null}.
2022-09-02T09:38:44.805715+00:00 app[web.1]:
com.google.ads.googleads.v11.errors.GoogleAdsException: errors {
2022-09-02T09:38:44.805717+00:00 app[web.1]: error_code {
2022-09-02T09:38:44.805718+00:00 app[web.1]: manager_link_error:
INVALID_STATUS_CHANGE
2022-09-02T09:38:44.805718+00:00 app[web.1]: }
2022-09-02T09:38:44.805719+00:00 app[web.1]: message: "The changed status
for mutate link is invalid."
2022-09-02T09:38:44.805719+00:00 app[web.1]: location {
2022-09-02T09:38:44.805720+00:00 app[web.1]: field_path_elements {
2022-09-02T09:38:44.805720+00:00 app[web.1]: field_name: "operations"
2022-09-02T09:38:44.805720+00:00 app[web.1]: index: 0
2022-09-02T09:38:44.805721+00:00 app[web.1]: }
2022-09-02T09:38:44.805721+00:00 app[web.1]: }
2022-09-02T09:38:44.805721+00:00 app[web.1]: }
2022-09-02T09:38:44.805722+00:00 app[web.1]: request_id:
"OwJ8Ou_ftfHlOQKlMe1O6Q"
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/d51775d2-5ead-40c9-8ac7-9ca325f222cfn%40googlegroups.com.