Hi Marc,
Thanks for reaching out to the Google Ads API Forum.
I had to delete your post since complete logs posted on the forum. For the
reference, you may refer to below without sensitive information:
“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:
MethodName:
google.ads.googleads.v11.services.CustomerManagerLinkService/MutateCustomerManagerLink
2022-09-02T09:38:44.796052+00:00 app[web.1]: Response
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"
”
Moving forward, I can see that you have used CustomerManagerLinkService to
link, and encountered an INVALID_STATUS_CHANGE error. It indicates that the
changed status for the mutate link is invalid. Since you mentioned that you
were trying to unlink a customer from said manager, and the status of the link
is ACTIVE. However, upon checking on our end, it is already INACTIVE while
trying to set .setStatus(ManagerLinkStatus.INACTIVE) in you request, and this
may have caused the above error. That being said, you may try to change the
status with valid status for the mutate link. If the issue still persists on
your end, then we would require the complete logs, where valid status is being
already set, and still you encountered the INVALID_STATUS_CHANGE error. Please
take note to send the complete logs to our team via reply privately to author
option.
Regards,
Yasar
Google Ads API Team
ref:_00D1U1174p._5004Q2dub0H:ref
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/HGyc5000000000000000000000000000000000000000000000RHL3IB00VMr0_xruTpeS_i-dy7iPQQ%40sfdc.net.