Hello,
I try to call TargetingIdeaService using the SDK (Google.AdWords NuGet, 
version 24.1.0 <https://www.nuget.org/packages/Google.AdWords/24.1.0>).
First I received a "CUSTOMER_NOT_ACTIVE" error. I created new credentials 
and generated a refresh token in console.developers.google.com 
<https://console.developers.google.com/apis/credentials?authuser=1&project=molten-team-517&supportedpurview=project>,
 
and the error changed to "Failed to refresh access token". I receive this 
error in the official tests project 
<https://developers.google.com/adwords/api/docs/samples/csharp/advanced-operations>
 I 
downloaded, so I guess that it's something in the credentials and not in 
the code.
Could you please help? Why does the token suppose to be refreshed if I just 
created it?

*The request code:*
             string accountId = "ACCOUNT_ID"; 

            AdWordsUser user = 
GoogleHelper.GetUserForTargetingIdeaService(accountId);

            using (var srv = 
user.GetService(AdWordsService.v201809.TargetingIdeaService) as 
TargetingIdeaService)
            {
                var pl = new List<SearchParameter>
                {
                   // ...
                };
                var selector = new TargetingIdeaSelector
                {
                    requestType = RequestType.STATS,
                    ideaType = IdeaType.KEYWORD,
                    paging = Paging.Default,
                    searchParameters = pl.ToArray(),
                    requestedAttributeTypes = new AttributeType[]
                    {
                        AttributeType.SEARCH_VOLUME, 
AttributeType.KEYWORD_TEXT,
                        AttributeType.AVERAGE_CPC, 
AttributeType.TARGETED_MONTHLY_SEARCHES, AttributeType.COMPETITION
                    }
                };
               
   TargetingIdeaPage page = await srv.getAsync(selector);
   // ...
          }

*The response:*
Google.Api.Ads.Common.Lib.AdsOAuthException: Failed to refresh access 
token. ---> System.AggregateException: One or more errors occurred. ---> 
Google.Apis.Auth.OAuth2.Responses.TokenResponseException: 
Error:"invalid_grant", Description:"Bad Request", Uri:""   at 
Google.Apis.Auth.OAuth2.Requests.TokenRequestExtenstions.<ExecuteAsync>d__0.MoveNext()
...

Thanks,
Gal

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"AdWords API and Google Ads 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/e8dcd1d1-5a15-40b6-b827-30353537656dn%40googlegroups.com.

Reply via email to