Hi. I'm trying to use the TargetingIdeaService with ASP.NET. This is my
code so far:
[HttpGet]
public IEnumerable<string> Get()
{
var user = new AdWordsUser();
using (TargetingIdeaService targetingIdeaService = (
TargetingIdeaService)user.GetService(AdWordsService.v201802.
TargetingIdeaService))
{
// Create selector.
TargetingIdeaSelector selector = new TargetingIdeaSelector
();
selector.requestType = RequestType.IDEAS;
selector.ideaType = IdeaType.KEYWORD;
selector.requestedAttributeTypes = new AttributeType[] {
AttributeType.KEYWORD_TEXT,
AttributeType.SEARCH_VOLUME,
AttributeType.AVERAGE_CPC,
AttributeType.COMPETITION,
AttributeType.CATEGORY_PRODUCTS_AND_SERVICES
};
// Set selector paging (required for targeting idea
service).
var paging = Paging.Default;
// Create related to query search parameter.
var relatedToQuerySearchParameter = new
RelatedToQuerySearchParameter { queries = new String[] { "bakery",
"pastries", "birthday cake" } };
var searchParameters = new List<SearchParameter> {
relatedToQuerySearchParameter };
var page = new TargetingIdeaPage();
page = targetingIdeaService.get(selector);
return new string[] { "value1", "value2" };
}
}
All looks good until when executing the code throws an invalid_grand error.
During debugging it turned out that the property "authorization_token" of
the user object is an empty string. All other credentials come from
app.config and are in the object.
I believe I'm missing a step, but I have no idea what the step is.
I'm building a REST API app, so console solutions won't work.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords 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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/5d1175bc-dc3c-44c5-989d-858d66031374%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.