Adhoc report call returns Missing client info, even though client is in the header...

295 views
Skip to first unread message

James Randell

unread,
Nov 17, 2014, 3:29:22 PM11/17/14
to adwor...@googlegroups.com
Thanks to anyone who can help!

I am trying to run a report using the example from the  adhoc report docs, as described in Reporting Basics and The AdWords Query Language.

WHAT I GET BACK: 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><reportDownloadError><ApiError><type>ReportDownloadError.INVALID_PARAMETER</type><trigger>Missing client information</trigger><fieldPath></fieldPath></ApiError></reportDownloadError>



WHAT I SEND: 
(returns inserted for clarity)
https://adwords.google.com/api/adwords/reportdownload/v201409?
Authorization=Bearer xxxxxxx&
developerToken
=xxxxxxx&
clientCustomerId
=xxx-xxx-xxx&
__rdquery
=SELECT+Name+FROM+KEYWORDS_PERFORMANCE_REPORT+DURING+20140101,20141231&
__fmt
=CSV

I am sending this from a desktop app which only allows me to send a URL and indicate its type (post, get, put, etc.)
The results I get are the same as pasting them into a browser (chrome)


Additional headers I have tried: all are returning the same response
    Content-Type=multipart/form-data
    Content-Type=application/x-www-form-urlencoded
    POST
    =/api/adwords/v201409 HTTP/1.1
    Host=adwords.google.com
Thanks for any help anyone has to provide, it is very much appreciated.
Sincerely,
Jim

Josh Radcliff (AdWords API Team)

unread,
Nov 17, 2014, 4:22:44 PM11/17/14
to adwor...@googlegroups.com
Hi Jim,

Are you passing the Authorization, developerToken, and clientCustomerId headers as HTTP headers or as HTTP parameters? It looks like you're passing them as HTTP parameters, but they need to be passed as HTTP headers.

Cheers,
Josh, AdWords API Team

James Randell

unread,
Nov 17, 2014, 7:59:21 PM11/17/14
to adwor...@googlegroups.com
Thanks Josh,
so far, I believe i have found a major issue: headers name/value pairs need to be separated by a colon. So that would make my original attempt look more like this:


https://adwords.google.com/api/adwords/reportdownload/v201409
Authorization:Bearer xxxxxxx&
developerToken
:xxxxxxx&
clientCustomerId
:xxx-xxx-xxx&
__rdquery
=SELECT+Name+FROM+KEYWORDS_PERFORMANCE_REPORT+DURING+20140101,20141231&
__fmt
=CSV
 

But I still get the same error, and I can not find an article that provides examples of what a complete inline string looks like. (there must be one out there).
And while I have used, and continue to seek out any number of http clients which help build URLs with headers, parameters, and body, I have not found one which shows the resulting URL string 'inline'.
(a single, inline string is all I can send)
So, where one article mentions that a question mark comes before the parameters (implying after the headers?), I have tried many variations of the question mark in different positions, or completely absent, the bottom line is, I cant figure out what this is supposed to "LOOK LIKE".

Now, I don’t want anyone to do any work for me, I did the entire AOuth2 part without asking for help, though it took almost a week, but I did it, on my own.
But this part (sending a request for a pre-defined report in csv format), has taken me almost twice that long. So I implore you, if you know what this urlURL should look like, please, please link me to an artical, or, consider replying with an example of what it should look like.

I will continue on my own, but some help would be so very much appreciated. if you give me an address, I will send you some home made rice crispy treats.

Very sincerely, 
-Jim

Josh Radcliff (AdWords API Team)

unread,
Nov 18, 2014, 9:16:47 AM11/18/14
to adwor...@googlegroups.com
Hi Jim,

You may want to check out the Message format section of the HTTP spec. I've never tried to do precisely what you're doing, but it sounds like what you need to do is embed newlines after each header, and then a blank line (two newline characters) after your headers.

Hope that helps!
Josh, AdWords API Team

James Randell

unread,
Nov 18, 2014, 6:01:19 PM11/18/14
to adwor...@googlegroups.com
Hi Josh, I'm getting closer.
Line endings would use the encoded char "%0d%0a"
So, that brings us to this call:


Authorization:Bearer xxxxxxx%0d%0a
developerToken:xxxxxxx%0d%0a
clientCustomerId:xxx-xxx-xxx%0d%0a
%0d%0a // two eol after last header
__rdquery=SELECT+Name+FROM+KEYWORDS_PERFORMANCE_REPORT+DURING+20140101,20141231%0d%0a
__fmt=CSV

 
And my Groovy call new response:
!!!2|||-1|||Report request does not include report ID or XML???

this seems like we have the line ending thing worked out, but as many variations as I have tried, I can not get the call to return the expected results, I feel, after so many attempts, its just one character or so off.
Any clues on your end?

Josh Radcliff (AdWords API Team)

unread,
Nov 19, 2014, 11:03:35 AM11/19/14
to adwor...@googlegroups.com
Hi Jim,

You might want to try adding the header:

Content-Type: application/x-www-form-urlencoded

Cheers,
Josh, AdWords API Team

James Randell

unread,
Nov 19, 2014, 1:03:31 PM11/19/14
to adwor...@googlegroups.com
Thank you Josh,
but s I mentioned earlier in the thread, I alternate content type as I test each call: from null, to  multipart/form-data, to application/x-www-form-urlencoded.

I am opening a second front using curl
should I start a second thread with the errors I get from curl?


Thanks again,
-Jim

Josh Radcliff (AdWords API Team)

unread,
Nov 19, 2014, 2:38:33 PM11/19/14
to adwor...@googlegroups.com
Hi Jim,

If you're using curl then you're in luck :). I already have an example:

curl --header 'Authorization: Bearer XXXX' --header 'clientCustomerId: xxx-xxx-xxxx' --header 'developerToken: XXX' --data __fmt=CSV --data '__rdquery=SELECT CampaignId, ClickType, Impressions FROM CAMPAIGN_PERFORMANCE_REPORT WHERE CampaignId = 123456789 DURING THIS_MONTH' https://adwords.google.com/api/adwords/reportdownload/v201409

Just replace the highlighted sections with the relevant portions for your OAuth token, customer ID, dev token, and query.

Cheers,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages