RE: INVALID_STATUS_CHANGE when attempting to setStatus(ManagerLinkStatus.INACTIVE)

137 views
Skip to first unread message
Message has been deleted

Google Ads API Forum Advisor

unread,
Sep 2, 2022, 9:16:14 AM9/2/22
to adoni...@gmail.com, adwor...@googlegroups.com

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,

Google Logo
Yasar
Google Ads API Team
 


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