Update keyword using Google Ads Rest API

790 views
Skip to first unread message

Dp Patel

unread,
Jun 9, 2021, 5:00:19 PM6/9/21
to AdWords API and Google Ads API Forum

Hello All,

I am new to Google Ads API and currently working on consuming several Google Ads API Endpoints to see how those works. I initially started with Campaign and I am able to Get all campaigns, Add/Update/Delete Campaigns. Now I am working through Keywords. I am so far able to Get Keywords but not been able to update/delete keywords. My API endpoint requestid is btzoTUpAGXxkzLuBwbdU3w. Can anyone help me out on this? Which object should we be doing a mutate operation? I am currently using  adGroupCriteria to update keyword -> text. Asking questions for the first time here, Please let me know if I need to provide more information.

Appreciate any response.

Google Ads API Forum Advisor

unread,
Jun 10, 2021, 11:47:51 AM6/10/21
to adspendapp...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out. As you could see here the keyword criterion is immutable which means it could not be updated via the API. Thus it’s not possible to mutate the keyword via the API.

Thanks and regards,
Xiaoming, Google Ads API Team
 

Google Logo
Xiaoming
Google Ads API Team
 


ref:_00D1U1174p._5004Q2I1Ycn:ref

Dp Patel

unread,
Jun 10, 2021, 1:35:08 PM6/10/21
to AdWords API and Google Ads API Forum
So there is now way we can update Keyword text after it's created using REST API? Can we do it using Client Library ? Because I see a method Update Keyword in the Example .NET client library project.

Also I was running AuthenticationInWebApplication project and It ran fine initially but now it's giving following error while trying to get campaign using the method in AuthenticationInWebApplication Project.

System.AggregateException
  HResult=0x80131500
  Message=One or more errors occurred. (Status(StatusCode="Unavailable", Detail="Getting metadata from plugin failed with error: Exception occurred in metadata credentials plugin. System.InvalidOperationException: The access token has expired and could not be refreshed. Errors: refresh error, refresh error, refresh error
   at Google.Apis.Auth.OAuth2.TokenRefreshManager.RefreshTokenAsync()
   at Google.Apis.Auth.OAuth2.TokenRefreshManager.GetAccessTokenForRequestAsync(CancellationToken cancellationToken)
   at Google.Apis.Auth.OAuth2.UserCredential.GetAccessTokenWithHeadersForRequestAsync(String authUri, CancellationToken cancellationToken)
   at Grpc.Auth.GoogleAuthInterceptors.<>c__DisplayClass3_0.<<FromCredential>b__0>d.MoveNext()

Could you please help me on this.

Google Ads API Forum Advisor

unread,
Jun 10, 2021, 4:17:42 PM6/10/21
to adspendapp...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out. The keyword could not be changed once it is created either via the Rest API endpoints directly or via the client libraries. The code example you shared is how to change the keyword for an ad group rather than updating the keyword itself. For your other question, please try to regenerate the refresh token and issue the call again.



Thanks and regards,
Xiaoming, Google Ads API Team

Dp Patel

unread,
Jun 14, 2021, 11:41:35 AM6/14/21
to AdWords API and Google Ads API Forum
I am running a AuthenticationInWebApplication  provided by Google and It says client library should be able to refresh token automatically. I have provided refresh token in the appsettings.json file for the AuthenticationInWebApplication project and it's not able to refresh the oauthtoken it looks like. Could you please help?
Message has been deleted
Message has been deleted

Google Ads API Forum Advisor

unread,
Jun 15, 2021, 3:43:49 PM6/15/21
to adspendapp...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out. Please share the complete request and response logs along with the configuration file via the Reply privately to author option for us to further investigate.



Thanks and regards,
Xiaoming, Google Ads API Team
 

Google Ads API Forum Advisor

unread,
Jun 16, 2021, 5:00:25 PM6/16/21
to adspendapp...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out. Please give it a try to regenerate the OAuth2 credentials including the refresh token using the PlayGround and make sure that when you generate the clientId and clientSecret you select the app type as Web app. Please give it a try and if the issue persists please share the complete request and response logs via the Reply privately to author option.



Thanks and regards,
Xiaoming, Google Ads API Team

Reply all
Reply to author
Forward
0 new messages