Entity not found -- INVALID_ID

1,353 views
Skip to first unread message

kitija...@gmail.com

unread,
Nov 21, 2018, 6:11:50 AM11/21/18
to AdWords API and Google Ads API Forum
Hello,

I'm trying to implement a switch between two Google Ads API accounts in one project.
The custom API code works as it should with the first account, but if I switch out the
  • ClientID,
  • ClientSecret,
  • RefreshToken
  • ClientCustomerId
for the other account, and try to save a GroupAd, it throws an -- Entity Not Found - Invalid_id -- error.
As seen in the error dump - The AdGroupId is set, but is also invalid, which (from the documentation) lead me to believe that the ID belongs to a different account (probably the first accounts).

Is there a way to get around this and make an automatic switch between two (or more) API accounts for one project?

Teja Makani

unread,
Nov 21, 2018, 12:11:27 PM11/21/18
to AdWords API and Google Ads API Forum
Hello Kitija,

The EntityNotFound.INVALID_ID error usually occurs when referencing the ID of an entity from a different account or referencing the ID of an entity that was removed. Changing the ClientID, ClientSecret, RefreshToken and ClientCustomerId will switch the account for sure. It looks like the AdGroup in the code belongs to other accounts and while switching to another account you are facing this issue. If the AdGroup ID is hard-coded, you could try to perform a get() operation via program instead and make sure correct AdGroup ID is passed for the account credentials used. If the problem persists please share the email ids of both the users that are authenticate the API call and the complete SOAP logs(request and response) of the failed operation without redacting any information. You could use reply privately to the author option while sharing the information requested.

Regards,
Sai Teja, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages