Re: OAUTH2 201206 .NET

2012-10-08 Thread okiebug1...@gmail.com
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: n)
webRequest.Headers.Add(Authorization: Bearer=access_token)
webRequest.Headers.Add(developerToken: nnn)
webRequest.Headers.Add(returnMoneyInMicros: true)

Here is my complete sanitized soap request:

POST /api/adwords/reportdownload/v201206 HTTP/1.1
clientCustomerId: x
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=reportDefinitionselectorfieldsDate/fieldsfieldsId/fieldsfieldsCampaignName/fieldsfieldsAdGroupName/fieldsfieldsCriteria/fieldsfieldsCriteriaType/fieldsfieldsCost/fieldsfieldsImpressions/fieldsfieldsClicks/fieldsfieldsCost/fieldsfieldsConversions/fieldsfieldsViewThroughConversions/fieldsfieldsCustomerDescriptiveName/fieldsfieldsAveragePosition/fieldsfieldsCtr/fieldsfieldsAverageCpc/fieldsfieldsConversionRate/fieldsfieldsCostPerConversion/fieldsfieldsConversionsManyPerClick/fieldsfieldsConversionValue/fieldsdateRangemin20121003/minmax20121003/max/dateRange/selectorreportNameCustom
 
CRITERIA_PERFORMANCE_REPORT/reportNamereportTypeCRITERIA_PERFORMANCE_REPORT/reportTypedateRangeTypeCUSTOM_DATE/dateRangeTypedownloadFormatXML/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


Re: OAUTH2 201206 .NET

2012-10-08 Thread okiebug1...@gmail.com
I found the solution, once I removed the = for the header Authorization: 
Bearer nn.
David

On Monday, October 8, 2012 8:22:05 AM UTC-4, okieb...@gmail.com wrote:

 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: n)
 webRequest.Headers.Add(Authorization: Bearer=access_token)
 webRequest.Headers.Add(developerToken: nnn)
 webRequest.Headers.Add(returnMoneyInMicros: true)

 Here is my complete sanitized soap request:

 POST /api/adwords/reportdownload/v201206 HTTP/1.1
 clientCustomerId: x
 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=reportDefinitionselectorfieldsDate/fieldsfieldsId/fieldsfieldsCampaignName/fieldsfieldsAdGroupName/fieldsfieldsCriteria/fieldsfieldsCriteriaType/fieldsfieldsCost/fieldsfieldsImpressions/fieldsfieldsClicks/fieldsfieldsCost/fieldsfieldsConversions/fieldsfieldsViewThroughConversions/fieldsfieldsCustomerDescriptiveName/fieldsfieldsAveragePosition/fieldsfieldsCtr/fieldsfieldsAverageCpc/fieldsfieldsConversionRate/fieldsfieldsCostPerConversion/fieldsfieldsConversionsManyPerClick/fieldsfieldsConversionValue/fieldsdateRangemin20121003/minmax20121003/max/dateRange/selectorreportNameCustom
  
 CRITERIA_PERFORMANCE_REPORT/reportNamereportTypeCRITERIA_PERFORMANCE_REPORT/reportTypedateRangeTypeCUSTOM_DATE/dateRangeTypedownloadFormatXML/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

Re: OAUTH2 201206 .NET

2012-10-04 Thread Anash P. Oommen
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


Re: OAUTH2 201206 .NET

2012-10-04 Thread okiebug1...@gmail.com
I appreciate your feedback.  I notice the format for the webservices' SOAP 
message header is a bit different for AdWords than it is for GA.  If 
possible can you point me to the documentation for the AdWords OAuth2 
please?

In GA, we are adding the following header to our SOAP message, 
Authorization: GoogleLogin auth= + Token, where Token is the access_token 
we extract from the response to the POST request made to 
https://accounts.google.com/o/oauth2/token with a message body 
refresh_token={0}client_id={1}client_secret={2}grant_type=refresh_token

It is also being passed as a parameter in the URL:
https://www.googleapis.com/analytics/v3/data/ga?ids={0}dimensions={1}metrics={2}start-date={3}end-date={4}sort={5}access_token={6};
   
Dim uri As String
uri = GetVisitURI(Token, ProfileID, from, todate)
myRequest = HttpWebRequest.Create(uri)
myRequest.Headers.Add(Authorization: GoogleLogin auth= + Token)
myResponse = myRequest.GetResponse

For AdWords I need to use the following header with the access_token?

myRequest.Headers.Add(Authorization: Bearer= + Token)

Thanks much!
David

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