Zero campaigns returned from call to CampaignService.get using Python AdWords SDK

2019-01-16 Thread Scott Burkhalter
I'm following the examples included in the googleads-python-lib to learn 
how to call Get on the CampaignsService 
- 
https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/v201809/basic_operations/get_campaigns.py

I'm receiving an empty response from the API - numEntries equals 0

Can someone help me understand why?

http://schemas.xmlsoap.org/soap/envelope/";>
  
https://adwords.google.com/api/adwords/cm/v201809";>
  REDACTED
  unknown (AwApi-Python, googleads/15.0.2, 
Python/2.7.15, zeep)
  false
  false

  
  
https://adwords.google.com/api/adwords/cm/v201809";>
  
Id
Name
Status

  0
  100

  

  



[2019-01-15 17:21:34,002 - googleads.soap - DEBUG] Incoming response: 
http://schemas.xmlsoap.org/soap/envelope/";>
  
https://adwords.google.com/api/adwords/cm/v201809";>
  00057f89193535f00a62b504be069a16
  CampaignService
  get
  1
  259

  
  
https://adwords.google.com/api/adwords/cm/v201809";>
  
0
CampaignPage
  

  




-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
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/37b08b58-7769-4c1a-b16a-b0e21be0c90d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Get all campaings using adWord API, return 0 result.

2019-01-16 Thread Scott Burkhalter
Make sure you have the "client_customer_id" value set in your 
configuration. It is one of your Account #'s and looks like 123-123-1234 if 
you look in the AdWords console

On Tuesday, January 15, 2019 at 2:26:32 PM UTC-8, buddyb...@gmail.com wrote:
>
>
> Hi
>
> I am new in adWords API,
>
> I just setup my test account, developer toker, client_id etc
>
> and i am running C# examples.
>
> I have 3 campaigns in my account.  and I am able to run the API call to 
> server as below:
>
>
>
>
>
> however, the return result was 0. as below:
>
>
>
>
> Do anyone can give a hint that where do i get wrong?
>
>
> Cheers
> Hei
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
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/8450dc6d-3ec3-4084-b088-164e3b868fc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Zero campaigns returned from call to CampaignService.get using Python AdWords SDK

2019-01-16 Thread Scott Burkhalter
That was the problem :) I had not specified the client_customer_id in the 
googleads.yaml file.

I need to iterate through a number of accounts for the task I've been 
assigned. Is there a python example of how to change the 
campaign_service.client_customer_id on the fly?

Would one create a new client for each account using the LoadFromString() 
method?

Or can I set the client_service.client_customer_id property on the fly 
prior to making my get() calls?

For pseudo-code example:


for ccid in list_of_customer_ids:
 # get the adwords client, would love to pass different client_customer_id 
to this but not sure how to do so
 client = adwords.AdWordsClient.LoadFromString(ccid)

 # or, instead, can I just set the property like this
 client.client_customer_id = ccid

 # obtain the campaign service proxy 
 campaign_service = client.GetService('CampaignService', version='v201809')

 #execute the query 
 query = (adwords.ServiceQueryBuilder()
 .Select('Id', 'Name', 'Status', 'Labels')
 .OrderBy('Name')
 .Limit(0, PAGE_SIZE)
 .Build())

 # do stuff with the campaigns

 for page in query.Pager(campaign_service):
... do stuff with campaign info...




Thanks for any guidance


On Wednesday, January 16, 2019 at 8:09:32 AM UTC-8, 
googleadsapi-forumadvisor wrote:
>
> Hello Scott,
>
> Could you please share the client customer id so that I can troubleshoot 
> the issue? Please note that to get the campaign data, you will need to run 
> the CampaignService.get 
> 
>  
> API call against the non manager Google Ads account. You can use 'Reply 
> privately to author' option while responding.
>
> Thanks,
> Milind, AdWords API Team
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
> Also find us on our blog and discussion group:
> http://googleadsdeveloper.blogspot.com/search/label/adwords_api
> https://developers.google.com/adwords/api/community/
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
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/42928aed-d056-48be-b8c9-35de779c419d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.