AdWords API Re: Inconsistency in docs, or not understanding a selector
On Thursday 25 March 2010, Joshua J. Kugler elucidated thus: > > Pete is correct, you need to need to pass in an empty selector. > > Here is an example using the PHP client library: > > > > http://code.google.com/p/google-api-adwords-php/source/browse/trunk > >/e xamples/v200909/GetAllCampaigns.php > > > > Also, ensure that the selector element has the correct namespace or > > else it won't be recognized by the API server. > > Thanks for all your replies. I figured out that my SOAP library > (suds, in this case) is not sending an empty object, which the > adwords API requires. I'll talk to the suds developers to see how to > work around this. Jeff Ortel (the suds maintainer) helped me with this on IRC (THANK YOU JEFF!) and we ended up figuring out this gave me the desired behavior: selector = client.factory.create('CampaignSelector') selector.statsSelector = ' ' print client.get(selector) Yes, you read right: that is setting statsSelector to a space. It then sends this to google: And google is perfectly happy with that: it returns all campaigns, all statistics. Thanks again Jeff and all the others for all your help! j -- Joshua Kugler Part-Time System Admin/Programmer http://www.eeinternet.com PGP Key: http://pgp.mit.edu/ ID 0x73B13B6A -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Have you migrated to v200909 yet? The v13 sunset is on April 22, 2010. Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords 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 To unsubscribe from this group, send email to adwords-api+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
AdWords API Re: Inconsistency in docs, or not understanding a selector
On Wednesday 24 March 2010, AdWords API Advisor elucidated thus: > Hi Joshua, > > Pete is correct, you need to need to pass in an empty selector. Here > is an example using the PHP client library: > > > http://code.google.com/p/google-api-adwords-php/source/browse/trunk/e >xamples/v200909/GetAllCampaigns.php > > Also, ensure that the selector element has the correct namespace or > else it won't be recognized by the API server. Thanks for all your replies. I figured out that my SOAP library (suds, in this case) is not sending an empty object, which the adwords API requires. I'll talk to the suds developers to see how to work around this. Thanks again! j > > Best, > - Eric Koleda, AdWords API Team > > On Mar 23, 3:18 pm, "Joshua J. Kugler" wrote: > > On Tuesday 23 March 2010, Pete Lavetsky (AdWords API Guru) > > elucidated > > > > thus: > > > I just create a new instance of a CampaignSelector and pass it > > > in. > > > > > > public List getAllCampaigns() throws Exception { > > > return get( new CampaignSelector() ); > > > } > > > > > > I don't know if you can approximate the same with PHP tho ... > > > > Yeah, I tried that too, and it threw the same error. Thanks for > > the tip, though. > > > > j > > > > > On Mar 23, 3:04 pm, "Joshua J. Kugler" wrote: > > > > The documentation for CampaignService.get() says: > > > > > > > > Parameters > > > > selector CampaignSelector filter to run campaigns through. If > > > > selector is empty, all campaigns are returned. > > > > > > > > But if I execute: > > > > CampaignService.get() > > > > or > > > > CampaignService.get({}) > > > > > > > > I get: Server raised fault: '[RequiredError.REQUIRED @ > > > > selector]' > > > > > > > > OK, so let's specify a selector. The docs for type > > > > CampaignSelector say: > > > > > > > > ids: The list of possible campaigns to be selected. ***An empty > > > > list indicates all account campaigns as possibly being > > > > selected.*** This field must contain distinct elements. This > > > > field must not contain null elements. > > > > > > > > campaignStatuses: Only campaigns having these statuses are > > > > selected. ***An empty list indicates all campaign statuses as > > > > being selected.*** This field must contain distinct elements. > > > > This field must not contain null elements. > > > > > > > > statsSelector: ***Indicates if stats should be returned; null > > > > will not return stats.*** > > > > > > > > paging: The starting index and number of results to return. > > > > > > > > So, with this selector: > > > > > > > > selector = { > > > > 'ids': [], > > > > 'campaignStatuses':[], > > > > 'statsSelector': None, > > > > 'paging':{ > > > > 'startIndex':0, > > > > 'numberResults':9 > > > > } > > > > > > > > } > > > > > > > > I still get: Server raised fault: '[RequiredError.REQUIRED @ > > > > selector]' Same error message if I leave out statsSelector > > > > completely, or set it to {} > > > > > > > > What, exactly, is required? It would be nice if the server > > > > fault told me what was missing. :) > > > > > > > > Thanks! > > > > > > > > j > > > > > > > > -- > > > > Joshua Kugler > > > > Part-Time System Admin/Programmerhttp://www.eeinternet.com > > > > PGP Key:http://pgp.mit.edu/ID 0x73B13B6A > > > > -- > > Joshua Kugler > > Part-Time System Admin/Programmerhttp://www.eeinternet.com > > PGP Key:http://pgp.mit.edu/ID 0x73B13B6A -- Joshua Kugler Part-Time System Admin/Programmer http://www.eeinternet.com PGP Key: http://pgp.mit.edu/ ID 0x73B13B6A -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Have you migrated to v200909 yet? The v13 sunset is on April 22, 2010. Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords 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 To unsubscribe from this group, send email to adwords-api+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
AdWords API Re: Inconsistency in docs, or not understanding a selector
Hi Joshua, Pete is correct, you need to need to pass in an empty selector. Here is an example using the PHP client library: http://code.google.com/p/google-api-adwords-php/source/browse/trunk/examples/v200909/GetAllCampaigns.php Also, ensure that the selector element has the correct namespace or else it won't be recognized by the API server. Best, - Eric Koleda, AdWords API Team On Mar 23, 3:18 pm, "Joshua J. Kugler" wrote: > On Tuesday 23 March 2010, Pete Lavetsky (AdWords API Guru) elucidated > thus: > > > I just create a new instance of a CampaignSelector and pass it in. > > > public List getAllCampaigns() throws Exception { > > return get( new CampaignSelector() ); > > } > > > I don't know if you can approximate the same with PHP tho ... > > Yeah, I tried that too, and it threw the same error. Thanks for the > tip, though. > > j > > > > > > > > > On Mar 23, 3:04 pm, "Joshua J. Kugler" wrote: > > > The documentation for CampaignService.get() says: > > > > Parameters > > > selector CampaignSelector filter to run campaigns through. If > > > selector is empty, all campaigns are returned. > > > > But if I execute: > > > CampaignService.get() > > > or > > > CampaignService.get({}) > > > > I get: Server raised fault: '[RequiredError.REQUIRED @ selector]' > > > > OK, so let's specify a selector. The docs for type CampaignSelector > > > say: > > > > ids: The list of possible campaigns to be selected. ***An empty > > > list indicates all account campaigns as possibly being selected.*** > > > This field must contain distinct elements. This field must not > > > contain null elements. > > > > campaignStatuses: Only campaigns having these statuses are > > > selected. ***An empty list indicates all campaign statuses as being > > > selected.*** This field must contain distinct elements. This field > > > must not contain null elements. > > > > statsSelector: ***Indicates if stats should be returned; null will > > > not return stats.*** > > > > paging: The starting index and number of results to return. > > > > So, with this selector: > > > > selector = { > > > 'ids': [], > > > 'campaignStatuses':[], > > > 'statsSelector': None, > > > 'paging':{ > > > 'startIndex':0, > > > 'numberResults':9 > > > } > > > > } > > > > I still get: Server raised fault: '[RequiredError.REQUIRED @ > > > selector]' Same error message if I leave out statsSelector > > > completely, or set it to {} > > > > What, exactly, is required? It would be nice if the server fault > > > told me what was missing. :) > > > > Thanks! > > > > j > > > > -- > > > Joshua Kugler > > > Part-Time System Admin/Programmerhttp://www.eeinternet.com > > > PGP Key:http://pgp.mit.edu/ID 0x73B13B6A > > -- > Joshua Kugler > Part-Time System Admin/Programmerhttp://www.eeinternet.com > PGP Key:http://pgp.mit.edu/ID 0x73B13B6A -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Have you migrated to v200909 yet? The v13 sunset is on April 22, 2010. Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords 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 To unsubscribe from this group, send email to adwords-api+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
AdWords API Re: Inconsistency in docs, or not understanding a selector
On Tuesday 23 March 2010, Pete Lavetsky (AdWords API Guru) elucidated thus: > I just create a new instance of a CampaignSelector and pass it in. > > public List getAllCampaigns() throws Exception { > return get( new CampaignSelector() ); > } > > I don't know if you can approximate the same with PHP tho ... Yeah, I tried that too, and it threw the same error. Thanks for the tip, though. j > > On Mar 23, 3:04 pm, "Joshua J. Kugler" wrote: > > The documentation for CampaignService.get() says: > > > > Parameters > > selector CampaignSelector filter to run campaigns through. If > > selector is empty, all campaigns are returned. > > > > But if I execute: > > CampaignService.get() > > or > > CampaignService.get({}) > > > > I get: Server raised fault: '[RequiredError.REQUIRED @ selector]' > > > > OK, so let's specify a selector. The docs for type CampaignSelector > > say: > > > > ids: The list of possible campaigns to be selected. ***An empty > > list indicates all account campaigns as possibly being selected.*** > > This field must contain distinct elements. This field must not > > contain null elements. > > > > campaignStatuses: Only campaigns having these statuses are > > selected. ***An empty list indicates all campaign statuses as being > > selected.*** This field must contain distinct elements. This field > > must not contain null elements. > > > > statsSelector: ***Indicates if stats should be returned; null will > > not return stats.*** > > > > paging: The starting index and number of results to return. > > > > So, with this selector: > > > > selector = { > > 'ids': [], > > 'campaignStatuses':[], > > 'statsSelector': None, > > 'paging':{ > > 'startIndex':0, > > 'numberResults':9 > > } > > > > } > > > > I still get: Server raised fault: '[RequiredError.REQUIRED @ > > selector]' Same error message if I leave out statsSelector > > completely, or set it to {} > > > > What, exactly, is required? It would be nice if the server fault > > told me what was missing. :) > > > > Thanks! > > > > j > > > > -- > > Joshua Kugler > > Part-Time System Admin/Programmerhttp://www.eeinternet.com > > PGP Key:http://pgp.mit.edu/�ID 0x73B13B6A -- Joshua Kugler Part-Time System Admin/Programmer http://www.eeinternet.com PGP Key: http://pgp.mit.edu/ ID 0x73B13B6A -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Have you migrated to v200909 yet? The v13 sunset is on April 22, 2010. Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords 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 To unsubscribe from this group, send email to adwords-api+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
AdWords API Re: Inconsistency in docs, or not understanding a selector
I just create a new instance of a CampaignSelector and pass it in. public List getAllCampaigns() throws Exception { return get( new CampaignSelector() ); } I don't know if you can approximate the same with PHP tho ... Pete On Mar 23, 3:04 pm, "Joshua J. Kugler" wrote: > The documentation for CampaignService.get() says: > > Parameters > selector CampaignSelector filter to run campaigns through. If selector > is empty, all campaigns are returned. > > But if I execute: > CampaignService.get() > or > CampaignService.get({}) > > I get: Server raised fault: '[RequiredError.REQUIRED @ selector]' > > OK, so let's specify a selector. The docs for type CampaignSelector say: > > ids: The list of possible campaigns to be selected. ***An empty list > indicates all account campaigns as possibly being selected.*** This > field must contain distinct elements. This field must not contain null > elements. > > campaignStatuses: Only campaigns having these statuses are selected. > ***An empty list indicates all campaign statuses as being selected.*** > This field must contain distinct elements. This field must not contain > null elements. > > statsSelector: ***Indicates if stats should be returned; null will not > return stats.*** > > paging: The starting index and number of results to return. > > So, with this selector: > > selector = { > 'ids': [], > 'campaignStatuses':[], > 'statsSelector': None, > 'paging':{ > 'startIndex':0, > 'numberResults':9 > } > > } > > I still get: Server raised fault: '[RequiredError.REQUIRED @ selector]' > Same error message if I leave out statsSelector completely, or set it to > {} > > What, exactly, is required? It would be nice if the server fault told > me what was missing. :) > > Thanks! > > j > > -- > Joshua Kugler > Part-Time System Admin/Programmerhttp://www.eeinternet.com > PGP Key:http://pgp.mit.edu/�ID 0x73B13B6A -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Have you migrated to v200909 yet? The v13 sunset is on April 22, 2010. Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords 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 To unsubscribe from this group, send email to adwords-api+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.