RE: Keyword stats [The String type doesn't accept collections as value]

2019-10-25 Thread Google Ads API Forum Advisor Prod
Hi,

Thanks for reaching out. The cause for the issue could be that when you first 
add the keyword strings in an array you already put them in the [ ], then you 
are not supposed to put this keywords array in another array, so you could use 
'queries': keywords in the code as opposed to 'queries': [keywords].

Please let me know if you have any further questions.

Thanks and Regards,
Xiaoming, Google Ads API Team
ref:_00D1U1174p._5001UKOTug:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/I4aRP0PZXWW600mLYezGwXTiSHBogQcEc6fQ%40sfdc.net.


Keyword stats [The String type doesn't accept collections as value]

2019-10-25 Thread itsnesky
My function receives as parameter an array (named: keyword) filled with n 
keywords. I want to extract the average monthly search volume of each one.

When I make the request like this, everything is ok

selector['searchParameters'] = [{
  'xsi_type': 'RelatedToQuerySearchParameter',
  'queries': ['kw1', 'kw2', 'kw3']
  }]

But when I assign to 'queries' my array, the API returns this error: *The 
String type doesn't accept collections as value*

selector['searchParameters'] = [{
  'xsi_type': 'RelatedToQuerySearchParameter',
  'queries': [keywords]
  }]

So I converted my array to string 

data = str(keywords).strip('[]')

So data = 'kw1', 'kw2', 'kw3'...

And then:

selector['searchParameters'] = [{
  'xsi_type': 'RelatedToQuerySearchParameter',
  'queries': [data]
  }]

It fixes the problem but the API doesn't send any info because 'data' is 
considered as a unique string and not like a collection of strings.

Any help?

Thanks!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/fbc93bb9-73ae-40a2-b082-632e134b9651%40googlegroups.com.