DotNet Library Upgrading to v201109 AdHoc Reports

295 views
Skip to first unread message

aengland

unread,
Jan 20, 2012, 8:09:22 AM1/20/12
to AdWords API Forum
I am using the DotNet Client Library and want to be sure I am
retrieving my report properly. I followed the below example that says
it is using the AdHoc Reports:
http://code.google.com/p/google-api-adwords-dotnet/source/browse/branches/v13.0/examples/csharp/v201109/DownloadAdhocReport.cs

I am retrieving the KEYWORDS_PERFORMANCE_REPORT (as opposed to the
ADGROUP_PERFORMANCE_REPORT in the example). Does the DotNet Client
Library make the HTTP Post with the report definition XML behind the
scenes when the DownloadClientReport method is called or is it still
using the SOAP API? Some other examples I see are posting in raw XML
which makes me wonder (such as this one https://gist.github.com/1287940)
what is the proper way to call the Ad Hoc reports. Thanks in advance.



Peter S.

unread,
Jan 20, 2012, 12:18:27 PM1/20/12
to AdWords API Forum
The DotNet Client does make the HTTP post with the report definition
xml. That example was prior to the release of the DotNet Client API
code being released but if you look under the hood its close to the
same but with the API code writing to xml for you from a
ReportDefinition. I should know it was my snippet.

On Jan 20, 6:09 am, aengland <aengl...@secure-res.com> wrote:
> I am using the DotNet Client Library and want to be sure I am
> retrieving my report properly.  I followed the below example that says
> it is using the AdHoc Reports:http://code.google.com/p/google-api-adwords-dotnet/source/browse/bran...
>
> I am retrieving the KEYWORDS_PERFORMANCE_REPORT (as opposed to the
> ADGROUP_PERFORMANCE_REPORT in the example).  Does the DotNet Client
> Library make the HTTP Post with the report definition XML behind the
> scenes when the DownloadClientReport method is called or is it still
> using the SOAP API?  Some other examples I see are posting in raw XML
> which makes me wonder (such as this onehttps://gist.github.com/1287940)

Anash P. Oommen

unread,
Jan 23, 2012, 9:36:46 PM1/23/12
to adwor...@googlegroups.com
Hi Peter,

Thanks for putting up that snippet! I'll link to this snippet when I update the NoClientLibrary wiki for AdWords API .NET library.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

Nalica

unread,
Feb 10, 2012, 3:53:57 AM2/10/12
to AdWords API Forum
I am trying to use the Adhoc Report API to download reports. I tried
both NoClientLibrary version (https://gist.github.com/1287940) and the
Library version (http://code.google.com/p/google-api-adwords-dotnet/
source/browse/branches/v13.0/examples/csharp/v201109/
DownloadAdhocReport.cs) but have not been able to get any reports
yet.

For the NoClientLibrary version, I got "Report contents are invalid.
- !!!2|||-1|||
[ReportDefinitionError.CUSTOMER_SERVING_TYPE_REPORT_MISMATCH @
selector]???". For the Library version, I got "The remote server
returned an error: (400) Bad Request." I did not change anything
other than the basic (user name, password, auth token, developer
token, client id). Does anybody know when went wrong or what I can do
to debug the issue?

Another thing that got me really confused is that I need to get the
auth token from the ClientLogin API for the NoClientLibrary version
(HTTP POST). But for the Library version, the code does not seem to
be getting the auth token from the ClientLogin API anywhere. Is the
AdWords API .NET Library handle that beind the scene somehow? If so,
does that mean it won't get the CAPTCHA challenge?

I am creating an automated process to download reports and it won't
have a UI capability to handle the CAPTCHA challenge. If the Library
version is not subjected to the CAPTCHA challenge, I would definitely
use the Library. Can somebody confirm please?

Thanks,
Nalica





On Jan 23, 8:36 pm, "Anash P. Oommen" <anash.p.oommen

Anash P. Oommen

unread,
Feb 10, 2012, 5:39:50 AM2/10/12
to adwor...@googlegroups.com
Hi Nalica,

CUSTOMER_SERVING_TYPE_REPORT_MISMATCH  typically means that you are trying to download a cross-client report using v201109 reports. v201109 API doesn't support cross-client reports any more and will throw errors if you request one. You need to request reports for one client at a time instead.

As for authToken - AdWords API .NET library also use them. You will find them being populated from AdWordsUser::Config::AuthToken. You get CAPTCHA challenges if you request a large number of authtokens in a short period of time. AuthTokens are long lived - typically a week, so you can request an AuthToken, save it locally, and use it until it expires. See http://adwordsapi.blogspot.in/2010/07/discover-v2009-working-with-authtokens.html for details.

Nalica

unread,
Feb 10, 2012, 11:48:48 AM2/10/12
to AdWords API Forum
Thanks Anash. I added auth token to the config file
(AdwordsUser::Config::AuthToken) and now I got the same
CUSTOMER_SERVING_TYPE_REPORT_MISMATCH error from both Library and
NoClientLibrary versions.

What do I need to do differently in order to not download a cross-
client report? I only have one client Id. If they represent
multiple clients, am I supposed to use individual client Id? If so,
where do I find such Ids and will each of them share the same
developer token?


On Feb 10, 4:39 am, "Anash P. Oommen" <anash.p.oommen
> AuthToken, save it locally, and use it until it expires. Seehttp://adwordsapi.blogspot.in/2010/07/discover-v2009-working-with-aut...for

Anash P. Oommen

unread,
Feb 13, 2012, 12:33:29 AM2/13/12
to adwor...@googlegroups.com
Hi Nalica,

There are 2 possibilities.

1) The customer id you have is an Advertiser account. If so, run a normal AdWords api report.
2) The customer id you have is an MCC account (and hence represents multiple accounts). In this case, use ServicedAccountService.get to retrieve the list of child accounts under this MCC. Then run one report each for each id thus retrieved.

You can share the same developer token, no issues on that front. Also, see 

Nalica

unread,
Feb 13, 2012, 11:48:45 AM2/13/12
to AdWords API Forum
Thanks Anash. The Id I have is an MCC account. I will use the API to
retrive the list of child accounts. I have some questions on the
CAPTCHA challenge. I am creating an automation to download the
report. It won't be possible to respond to the CAPTCHA challenge
within the automation. I have about 20 - 30 accounts under the MCC
account. I am planing to re-use the same auth token for each account
but I am wondering if it is possible to get a CAPTCHA challenge for
calling the Ad Hoc report API multiple times in a short period of
time.

On Feb 12, 11:33 pm, "Anash P. Oommen" <anash.p.oommen
+fo...@google.com> wrote:
> Hi Nalica,
>
> There are 2 possibilities.
>
> 1) The customer id you have is an Advertiser account. If so, run a normal
> AdWords api report.
> 2) The customer id you have is an MCC account (and hence represents
> multiple accounts). In this case, use ServicedAccountService.get to
> retrieve the list of child accounts under this MCC. Then run one report
> each for each id thus retrieved.
>
> You can share the same developer token, no issues on that front. Also, see
>
> 1. Getting account hierarchy:http://code.google.com/p/google-api-adwords-dotnet/source/browse/trun...
> 2. Reporting for a single advertiser account:http://code.google.com/apis/adwords/docs/guides/reporting.html, andhttp://code.google.com/p/google-api-adwords-dotnet/source/browse/trun...if

Anash P. Oommen

unread,
Feb 13, 2012, 10:06:59 PM2/13/12
to adwor...@googlegroups.com
Hi Nalica,

CAPTCHA challenge is thrown by the ClientLogin API (http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html) if you request a large number of authTokens in a short period of time. It has nothing to do with AdWords API as such, so if you reuse your authTokens, you won't get Captcha challenges if you download several reports in a short period of time. I recommend this: Get an authToken as the first call in your script, then use that token to download all the reports. You won't get any CAPTCHA challenges at all this way.

Nalica

unread,
Feb 15, 2012, 2:20:02 AM2/15/12
to AdWords API Forum
Thanks Anash. I got most of my problems solved. One last issue
(hopefully) that I have to figure out is that currently I am getting a
Creative report through the ReportService v13. I went through all
reportType supported by the AdHoc Report v201109 and the closest thing
seemed to be CREATIVE_CONVERSION_REPORT . This reportType has
CreativeId but it does not have ImageAdName, CreativeType,
DescriptionLine1, DescriptionLine2, DescriptionLine3, or VisibleUrl.
Are these fields no longer supported?

FY: below is the v13 report definition that I am using.
<aggregationTypes>Daily</aggregationTypes>
<startDay>2011-01-01</startDay>
<endDay>2011-01-10</endDay>
<name>Creative Report</name>
<selectedReportType>Creative</selectedReportType>
<crossClient>true</crossClient>
<selectedColumns>CreativeId</selectedColumns>
<selectedColumns>ImageAdName</selectedColumns>
<selectedColumns>CustomerName</selectedColumns>
<selectedColumns>CreativeType</selectedColumns>
<selectedColumns>DescriptionLine1</selectedColumns>
<selectedColumns>DescriptionLine2</selectedColumns>
<selectedColumns>DescriptionLine3</selectedColumns>
<selectedColumns>VisibleUrl</selectedColumns>


On Feb 13, 9:06 pm, "Anash P. Oommen" <anash.p.oommen

Eric Koleda

unread,
Feb 21, 2012, 4:49:09 PM2/21/12
to adwor...@googlegroups.com
Hi,

Creatives are known as ads in the latest versions of the API, and likewise the corresponding report is the AD_PERFORMANCE_REPORT:


Best,
- Eric Koleda, AdWords API Team
Reply all
Reply to author
Forward
0 new messages