I have my refresh token and am receiving a 400 - bad request when 
attempting to get report id.  

Can you please point me to the documentation for the proper headers needed 
to make requests?

You mentioned the need for an Authorization: Bearer xxx and I am unsure of 
the proper format.

I am using the following headers:

webRequest.Headers.Add("clientCustomerId: nnnnn")
webRequest.Headers.Add("Authorization: Bearer=access_token")
webRequest.Headers.Add("developerToken: nnnnnnn")
webRequest.Headers.Add("returnMoneyInMicros: true")

Here is my complete sanitized soap request:

POST /api/adwords/reportdownload/v201206 HTTP/1.1
clientCustomerId: xxxxxxxxx
Authorization: Bearer=access_token
developerToken: devtoken
returnMoneyInMicros: true
Content-Type: application/x-www-form-urlencoded
Host: adwords.google.com
Content-Length: 883
Expect: 100-continue

__rdxml=<reportDefinition><selector><fields>Date</fields><fields>Id</fields><fields>CampaignName</fields><fields>AdGroupName</fields><fields>Criteria</fields><fields>CriteriaType</fields><fields>Cost</fields><fields>Impressions</fields><fields>Clicks</fields><fields>Cost</fields><fields>Conversions</fields><fields>ViewThroughConversions</fields><fields>CustomerDescriptiveName</fields><fields>AveragePosition</fields><fields>Ctr</fields><fields>AverageCpc</fields><fields>ConversionRate</fields><fields>CostPerConversion</fields><fields>ConversionsManyPerClick</fields><fields>ConversionValue</fields><dateRange><min>20121003</min><max>20121003</max></dateRange></selector><reportName>Custom
 
CRITERIA_PERFORMANCE_REPORT</reportName><reportType>CRITERIA_PERFORMANCE_REPORT</reportType><dateRangeType>CUSTOM_DATE</dateRangeType><downloadFormat>XML</downloadFormat></reportDefinition>


And the response:

HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=UTF-8
Date: Mon, 08 Oct 2012 12:14:44 GMT
Expires: Mon, 08 Oct 2012 12:14:44 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Transfer-Encoding: chunked

c2
!!!2|||-1|||<eye3-stackless title='AuthServer User Error 
OAUTH_TOKEN_HEADER_INVALID'/> 
AuthenticationError.OAUTH_TOKEN_HEADER_INVALID @ ; trigger:'<null>'; 
errorDetails:message=Invalid Header???
0

Thanks much,

On Thursday, October 4, 2012 10:42:39 AM UTC-4, Anash P. Oommen wrote:
>
> Hi,
>
> OAuth2 scope for AdWords API is https://adwords.google.com/api/adwords/or 
> https://adwords-sandbox.google.com/api/adwords/ depending on whether you 
> are making calls to AdWords API production or sandbox environment. As with 
> the other services, you get the OAuth2 client id and secret from 
> https://code.google.com/apis/console, just that you don't need to turn on 
> support for AdWords API, it will just work.
>
> Other than that, the AdWords API uses OAuth2 just like the way any other 
> service does - add an Authorization: Bearer xxx http header to your 
> outgoing SOAP message.
>
> Cheers,
> Anash P. Oommen,
> AdWords API Advisor
>
> On Thursday, 4 October 2012 19:46:56 UTC+5:30, okieb...@gmail.com wrote:
>>
>> I'm trying to schedule migration for my reporting apps.  I successfully 
>> moved all my Google Analytics data webservice consumption from the client 
>> log-in to OAUTH2.  In order to achieve this I needed to register my 
>> "Installed App" at https://code.google.com/apis/console and use the 
>> Client ID and secret, etc.  When I attempted to do this for AdWords API, I 
>> did not see an AdWords API in the "Services" section, so I simply used the 
>> API Access section to register my "Installed App", and noted the generated 
>> settings.  So my question is, does the AdWords API for version 
>> 201206 support OAUTH2 or should I continue to use the clientLogInUrl As 
>> String = "https://www.google.com/accounts/ClientLogin"; logic for my 
>> authentication?  I'm using in-house home-grown .NET code and not the client 
>> libraries.
>>
>> Next if OAUTH2 is supported, is the registration process via the 
>> /apis/console/ the proper way, I'm not sure since there was not an AdWords 
>> w/n the list of "Services"? Also, what would be the proper "scope" 
>> parameter for the generation of an "Auth Grant" via 
>> https://accounts.google.com/o/oauth2/auth, for GA it was: 
>> scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fanalytics.readonly.  
>>
>> I am following the documentation found here: http://goo.gl/R9xYB
>>
>> Thanks for your assistance,
>> David  
>>
>>

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

Reply via email to