Re: Can't reuse oauth2 token - gives me OAUTH_TOKEN_INVALID (Ruby client lib)

2013-07-29 Thread Paul Matthews (AdWords API Team)
Hi Matthew,

Looking at your response, it seems like your scope is incorrect. Below is 
an example if I perform the same request.

{
 issued_to: 
0-a0a00a00a00aa0aa0aa000aa.apps.googleusercontent.com,
 audience: 
0-a0a00a00a00aa0aa0aa000aa.apps.googleusercontent.com,
 scope: *https://adwords.google.com/api/adwords/*;,
 expires_in: 3296,
 access_type: offline
}


How is it that you're creating the access_token?


Cheers,

- Paul, AdWords API Team.


On Friday, 26 July 2013 04:41:05 UTC+1, Matthew Ledom wrote:

 I deployed my working setup to a staging environment and now I get 
 the OAUTH_TOKEN_INVALID issue. I have checked the tokeninfo service and it 
 says its a valid token. I pasted the  output below. What are some reasons 
 for invalid tokens?

 {

- issued_to: 106...96.apps.googleusercontent.com,
- audience: 106...96.apps.googleusercontent.com,
- user_id: 116...117,
- scope: https://www.googleapis.com/auth/userinfo.email 
https://www.googleapis.com/auth/plus.me;,
- expires_in: 2589,
- email: adwor...@test.com javascript:,
- verified_email: true,
- access_type: offline

 }

 On Monday, July 22, 2013 9:57:59 AM UTC-4, Paul Matthews (AdWords API 
 Team) wrote:

 Hi Matthew,

 The Ruby OAuth2 
 infohttps://code.google.com/p/google-api-ads-ruby/wiki/OAuth2 along 
 with the 
 READMEhttps://code.google.com/p/google-api-ads-ruby/source/browse/adwords_api/README#31
  should 
 explain all the steps for configuring your client. But it's worth testing 
 the setup_oauth2.rb 
 examplehttps://code.google.com/p/google-api-ads-ruby/source/browse/adwords_api/examples/v201306/misc/setup_oauth2.rb,
  
 to see if that resolves the issue.

 Finally, if you're receiving a token, but when used it responds with 
 OAUTH_TOKEN_INVALID, we recommend checking your token with the tokeninfo 
 servicehttps://developers.google.com/accounts/docs/OAuth2Login#validatinganidtoken.
  
 Once you've received a token response, you can send it to the tokeninfo 
 service, for information on the token. See below for an example.

 https://www.googleapis.com/oauth2/v1/tokeninfo?id_token=*TOKEN 
 HERE*https://www.googleapis.com/oauth2/v1/tokeninfo?id_token=
 .

 Regards,

 - Paul, AdWords API Team.



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

--- 
You received this message because you are subscribed to the Google Groups 
AdWords API Forum group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can't reuse oauth2 token - gives me OAUTH_TOKEN_INVALID (Ruby client lib)

2013-07-25 Thread Matthew Ledom
I deployed my working setup to a staging environment and now I get 
the OAUTH_TOKEN_INVALID issue. I have checked the tokeninfo service and it 
says its a valid token. I pasted the  output below. What are some reasons 
for invalid tokens?

{
   
   - issued_to: 106...96.apps.googleusercontent.com,
   - audience: 106...96.apps.googleusercontent.com,
   - user_id: 116...117,
   - scope: https://www.googleapis.com/auth/userinfo.email 
   https://www.googleapis.com/auth/plus.me;,
   - expires_in: 2589,
   - email: adwords...@test.com,
   - verified_email: true,
   - access_type: offline
   
}

On Monday, July 22, 2013 9:57:59 AM UTC-4, Paul Matthews (AdWords API Team) 
wrote:

 Hi Matthew,

 The Ruby OAuth2 
 infohttps://code.google.com/p/google-api-ads-ruby/wiki/OAuth2 along 
 with the 
 READMEhttps://code.google.com/p/google-api-ads-ruby/source/browse/adwords_api/README#31
  should 
 explain all the steps for configuring your client. But it's worth testing 
 the setup_oauth2.rb 
 examplehttps://code.google.com/p/google-api-ads-ruby/source/browse/adwords_api/examples/v201306/misc/setup_oauth2.rb,
  
 to see if that resolves the issue.

 Finally, if you're receiving a token, but when used it responds with 
 OAUTH_TOKEN_INVALID, we recommend checking your token with the tokeninfo 
 servicehttps://developers.google.com/accounts/docs/OAuth2Login#validatinganidtoken.
  
 Once you've received a token response, you can send it to the tokeninfo 
 service, for information on the token. See below for an example.

 https://www.googleapis.com/oauth2/v1/tokeninfo?id_token=*TOKEN 
 HERE*https://www.googleapis.com/oauth2/v1/tokeninfo?id_token=
 .

 Regards,

 - Paul, AdWords API Team.


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

--- 
You received this message because you are subscribed to the Google Groups 
AdWords API Forum group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: OAUTH_TOKEN_INVALID ruby client

2013-07-22 Thread Takeshi Hagikura (AdWords API Team)
Hi Matthew,

Looks like the access_token (it expires in one hour) was issued at 
2013-07-19 14:56:06 -0400.
So at the time you made a request, the access token seemed to expire. 

If you make the oauth token request in offline mode, the response should 
contain refresh_token (that never expires). 
Using that you can get a new access toke if the existing access token is 
about to expire. 

I'm asking the ruby library maintainer on how to make a offline oauth token 
request in more detail. 

Best,
- Takeshi, AdWords API Team

On Saturday, July 20, 2013 4:01:13 AM UTC+9, Matthew Ledom wrote:

 I keep receiving this error when I try to use a service. In this instance 
 I'm use the campaign service. I had everything working with ClientLogin and 
 found that Reports are only supported with OAUTH2 so I'm trying to get that 
 implemented.

 I have setup my app to retrieve a offline token via the browser redirect 
 work flow. I have also setup my adword model to request a new access token 
 using the provided refresh token from the previous step. I can take that 
 token and use it in the following code:

 api.authorize(:oauth2_token = token )

 where token:
 {access_token=ya29.AxxxXh6zvQ,
  token_type=Bearer,
  expires_in=3600,
  id_token=
   eyJhbxxxB3MO4}

 this returns:
 {:access_token=ya29.AHEJXh6zvQ,
  :refresh_token=nil,
  :issued_at=2013-07-19 14:56:06 -0400,
  :expires_in=3600,
  :id_token=
   eyJhbxxxLB3MO4}

 When I use this api object to call the campaign service I get the output 
 provided below. The reporting download is the final piece needed to 
 approval and I've searched all over this group and the web and can't find 
 anything that helps. I'm using the latest versions of the ruby gem: 
 google-ads-common (0.9.3) and google-adwords-api (0.9.3) 

 SOAP request: 
 https://adwords.google.com/api/adwords/cm/v201302/CampaignService
 Accept-Encoding: gzip,deflate, SOAPAction: get, User-Agent: bw_console 
 (AwApi-Ruby/0.9.3, Common-Ruby/0.9.3, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, 
 curb), Authorization: Bearer ya29.AHxXh6zvQ, Content-Type: 
 text/xml;charset=UTF-8, Content-Length: 837
 ?xml version=1.0 encoding=UTF-8?env:Envelope xmlns:xsd=
 http://www.w3.org/2001/XMLSchema; xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance; xmlns:wsdl=
 https://adwords.google.com/api/adwords/cm/v201302; xmlns:env=
 http://schemas.xmlsoap.org/soap/envelope/;env:Headerwsdl:RequestHeader 
 xmlns=https://adwords.google.com/api/adwords/cm/v201302;userAgentconsole 
 (AwApi-Ruby/0.9.3, Common-Ruby/0.9.3, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, 
 curb)/userAgentdeveloperTokenh6Axxxweg/developerToken/wsdl:RequestHeader/env:Headerenv:Bodyget
  
 xmlns=https://adwords.google.com/api/adwords/cm/v201302
 serviceSelectorfieldsId/fieldsfieldsName/fieldsfieldsStatus/fieldsorderingfieldName/fieldsortOrderASCENDING/sortOrder/ordering/serviceSelector/get/env:Body/env:Envelope
 HTTPI executes HTTP POST using the curb adapter
 SOAP response (status 500):
 soap:Envelope 
 xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;soap:HeaderResponseHeader
  
 xmlns=https://adwords.google.com/api/adwords/cm/v201302;requestId0004e1e1b8b62a800aed881c1a3b/requestIdserviceNameCampaignService/serviceNamemethodNameget/methodNameoperations0/operationsresponseTime23/responseTimeunits0/units/ResponseHeader/soap:Headersoap:Bodysoap:Faultfaultcodesoap:Server/faultcodefaultstring[AuthenticationError.OAUTH_TOKEN_INVALID
  
 @ ; trigger:'lt;nullgt;']/faultstringdetailApiExceptionFault xmlns=
 https://adwords.google.com/api/adwords/cm/v201302;message[AuthenticationError.OAUTH_TOKEN_INVALID
  
 @ ; 
 trigger:'lt;nullgt;']/messageApplicationException.TypeApiException/ApplicationException.Typeerrors
  
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
 xsi:type=AuthenticationErrorfieldPath/fieldPathtriggerlt;nullgt;/triggererrorStringAuthenticationError.OAUTH_TOKEN_INVALID/errorStringApiError.TypeAuthenticationError/ApiError.TypereasonOAUTH_TOKEN_INVALID/reason/errors/ApiExceptionFault/detail/soap:Fault/soap:Body/soap:Envelope
 Content-Type: text/xml; charset=UTF-8, Date: Fri, 19 Jul 2013 18:44:49 
 GMT, Expires: Fri, 19 Jul 2013 18:44:49 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
 AdwordsApi::V201302::CampaignService::ApiException: 
 [AuthenticationError.OAUTH_TOKEN_INVALID @ ; trigger:'null']

 Thank you to anyone that can help. I really need to get this integration 
 completed.


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

Re: Can't reuse oauth2 token - gives me OAUTH_TOKEN_INVALID (Ruby client lib)

2013-07-22 Thread Paul Matthews (AdWords API Team)
Hi Matthew,

The Ruby OAuth2 infohttps://code.google.com/p/google-api-ads-ruby/wiki/OAuth2 
along 
with the 
READMEhttps://code.google.com/p/google-api-ads-ruby/source/browse/adwords_api/README#31
 should 
explain all the steps for configuring your client. But it's worth testing 
the setup_oauth2.rb 
examplehttps://code.google.com/p/google-api-ads-ruby/source/browse/adwords_api/examples/v201306/misc/setup_oauth2.rb,
 
to see if that resolves the issue.

Finally, if you're receiving a token, but when used it responds with 
OAUTH_TOKEN_INVALID, we recommend checking your token with the tokeninfo 
servicehttps://developers.google.com/accounts/docs/OAuth2Login#validatinganidtoken.
 
Once you've received a token response, you can send it to the tokeninfo 
service, for information on the token. See below for an example.

https://www.googleapis.com/oauth2/v1/tokeninfo?id_token=*TOKEN 
HERE*https://www.googleapis.com/oauth2/v1/tokeninfo?id_token=
.

Regards,

- Paul, AdWords API Team.

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

--- 
You received this message because you are subscribed to the Google Groups 
AdWords API Forum group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can't reuse oauth2 token - gives me OAUTH_TOKEN_INVALID (Ruby client lib)

2013-07-22 Thread Matthew Ledom
I was finally able to get it working. I had to merge my stored token values 
with the loaded config params from the adwords_api.yml file.  Trying to 
figure out how to set the token after the api object was created was 
causing issues. I used the setup_oauth2.rb example to write the values to 
my config and removed the token information. I'm storing that data in the 
db and load when I need to use it.:

config = File.join( Rails.root, 'config', 'adwords_api.yml' )
config_data = YAML::load_file( config )
config_data[:authentication].merge!({
  :oauth2_token = {
:chunking = true,
:access_token = self.access_token,
:refresh_token = self.refresh_token,
:issued_at = self.expires_at - 3600,
:expires_in = 3600
  }
})
@api = AdwordsApi::Api.new( config_data )

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

--- 
You received this message because you are subscribed to the Google Groups 
AdWords API Forum group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: OAUTH_TOKEN_INVALID ruby client

2013-07-22 Thread Matthew Ledom
Thanks I would like to know the correct way to do this. I have not found an 
example the uses a refresh token that is stored in a db. I have seen the 
setup_oauth2.rb example where the refresh token is written to a file. 
Creating a new AdwordsApi::Api with the yml file and setting credentials 
does not seem to work.

On Monday, July 22, 2013 2:13:02 AM UTC-4, Takeshi Hagikura (AdWords API 
Team) wrote:

 Hi Matthew,

 Looks like the access_token (it expires in one hour) was issued at 
 2013-07-19 14:56:06 -0400.
 So at the time you made a request, the access token seemed to expire. 

 If you make the oauth token request in offline mode, the response should 
 contain refresh_token (that never expires). 
 Using that you can get a new access toke if the existing access token is 
 about to expire. 

 I'm asking the ruby library maintainer on how to make a offline oauth 
 token request in more detail. 

 Best,
 - Takeshi, AdWords API Team

 On Saturday, July 20, 2013 4:01:13 AM UTC+9, Matthew Ledom wrote:

 I keep receiving this error when I try to use a service. In this instance 
 I'm use the campaign service. I had everything working with ClientLogin and 
 found that Reports are only supported with OAUTH2 so I'm trying to get that 
 implemented.

 I have setup my app to retrieve a offline token via the browser redirect 
 work flow. I have also setup my adword model to request a new access token 
 using the provided refresh token from the previous step. I can take that 
 token and use it in the following code:

 api.authorize(:oauth2_token = token )

 where token:
 {access_token=ya29.AxxxXh6zvQ,
  token_type=Bearer,
  expires_in=3600,
  id_token=
   eyJhbxxxB3MO4}

 this returns:
 {:access_token=ya29.AHEJXh6zvQ,
  :refresh_token=nil,
  :issued_at=2013-07-19 14:56:06 -0400,
  :expires_in=3600,
  :id_token=
   eyJhbxxxLB3MO4}

 When I use this api object to call the campaign service I get the output 
 provided below. The reporting download is the final piece needed to 
 approval and I've searched all over this group and the web and can't find 
 anything that helps. I'm using the latest versions of the ruby gem: 
 google-ads-common (0.9.3) and google-adwords-api (0.9.3) 

 SOAP request: 
 https://adwords.google.com/api/adwords/cm/v201302/CampaignService
 Accept-Encoding: gzip,deflate, SOAPAction: get, User-Agent: bw_console 
 (AwApi-Ruby/0.9.3, Common-Ruby/0.9.3, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, 
 curb), Authorization: Bearer ya29.AHxXh6zvQ, Content-Type: 
 text/xml;charset=UTF-8, Content-Length: 837
 ?xml version=1.0 encoding=UTF-8?env:Envelope xmlns:xsd=
 http://www.w3.org/2001/XMLSchema; xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance; xmlns:wsdl=
 https://adwords.google.com/api/adwords/cm/v201302; xmlns:env=
 http://schemas.xmlsoap.org/soap/envelope/;env:Headerwsdl:RequestHeader 
 xmlns=https://adwords.google.com/api/adwords/cm/v201302;userAgentconsole 
 (AwApi-Ruby/0.9.3, Common-Ruby/0.9.3, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, 
 curb)/userAgentdeveloperTokenh6Axxxweg/developerToken/wsdl:RequestHeader/env:Headerenv:Bodyget
  
 xmlns=https://adwords.google.com/api/adwords/cm/v201302
 serviceSelectorfieldsId/fieldsfieldsName/fieldsfieldsStatus/fieldsorderingfieldName/fieldsortOrderASCENDING/sortOrder/ordering/serviceSelector/get/env:Body/env:Envelope
 HTTPI executes HTTP POST using the curb adapter
 SOAP response (status 500):
 soap:Envelope 
 xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;soap:HeaderResponseHeader
  
 xmlns=https://adwords.google.com/api/adwords/cm/v201302;requestId0004e1e1b8b62a800aed881c1a3b/requestIdserviceNameCampaignService/serviceNamemethodNameget/methodNameoperations0/operationsresponseTime23/responseTimeunits0/units/ResponseHeader/soap:Headersoap:Bodysoap:Faultfaultcodesoap:Server/faultcodefaultstring[AuthenticationError.OAUTH_TOKEN_INVALID
  
 @ ; trigger:'lt;nullgt;']/faultstringdetailApiExceptionFault xmlns=
 https://adwords.google.com/api/adwords/cm/v201302;message[AuthenticationError.OAUTH_TOKEN_INVALID
  
 @ ; 
 trigger:'lt;nullgt;']/messageApplicationException.TypeApiException/ApplicationException.Typeerrors
  
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
 xsi:type=AuthenticationErrorfieldPath/fieldPathtriggerlt;nullgt;/triggererrorStringAuthenticationError.OAUTH_TOKEN_INVALID/errorStringApiError.TypeAuthenticationError/ApiError.TypereasonOAUTH_TOKEN_INVALID/reason/errors/ApiExceptionFault/detail/soap:Fault/soap:Body/soap:Envelope
 Content-Type: text/xml; charset=UTF-8, Date: Fri, 19 Jul 2013 18:44:49 
 GMT, Expires: Fri, 19 Jul 2013 18:44:49 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
 AdwordsApi::V201302::CampaignService::ApiException: 
 [AuthenticationError.OAUTH_TOKEN_INVALID @ ; trigger:'null']

 Thank you to anyone that can help. I really need to get this integration 
 completed.



-- 
-- 

Re: OAUTH_TOKEN_INVALID ruby client

2013-07-22 Thread Takeshi Hagikura (AdWords API Team)
Hi, 

Looks like you are already talking with the ruby library maintainer in 
another mail thread. 
Please update the thread about it. 

Best,
- Takeshi, AdWords API Team

On Tuesday, July 23, 2013 2:53:29 AM UTC+9, Matthew Ledom wrote:

 Thanks I would like to know the correct way to do this. I have not found 
 an example the uses a refresh token that is stored in a db. I have seen the 
 setup_oauth2.rb example where the refresh token is written to a file. 
 Creating a new AdwordsApi::Api with the yml file and setting credentials 
 does not seem to work.

 On Monday, July 22, 2013 2:13:02 AM UTC-4, Takeshi Hagikura (AdWords API 
 Team) wrote:

 Hi Matthew,

 Looks like the access_token (it expires in one hour) was issued at 
 2013-07-19 14:56:06 -0400.
 So at the time you made a request, the access token seemed to expire. 

 If you make the oauth token request in offline mode, the response should 
 contain refresh_token (that never expires). 
 Using that you can get a new access toke if the existing access token is 
 about to expire. 

 I'm asking the ruby library maintainer on how to make a offline oauth 
 token request in more detail. 

 Best,
 - Takeshi, AdWords API Team

 On Saturday, July 20, 2013 4:01:13 AM UTC+9, Matthew Ledom wrote:

 I keep receiving this error when I try to use a service. In this 
 instance I'm use the campaign service. I had everything working with 
 ClientLogin and found that Reports are only supported with OAUTH2 so I'm 
 trying to get that implemented.

 I have setup my app to retrieve a offline token via the browser redirect 
 work flow. I have also setup my adword model to request a new access token 
 using the provided refresh token from the previous step. I can take that 
 token and use it in the following code:

 api.authorize(:oauth2_token = token )

 where token:
 {access_token=ya29.AxxxXh6zvQ,
  token_type=Bearer,
  expires_in=3600,
  id_token=
   eyJhbxxxB3MO4}

 this returns:
 {:access_token=ya29.AHEJXh6zvQ,
  :refresh_token=nil,
  :issued_at=2013-07-19 14:56:06 -0400,
  :expires_in=3600,
  :id_token=
   eyJhbxxxLB3MO4}

 When I use this api object to call the campaign service I get the output 
 provided below. The reporting download is the final piece needed to 
 approval and I've searched all over this group and the web and can't find 
 anything that helps. I'm using the latest versions of the ruby gem: 
 google-ads-common (0.9.3) and google-adwords-api (0.9.3) 

 SOAP request: 
 https://adwords.google.com/api/adwords/cm/v201302/CampaignService
 Accept-Encoding: gzip,deflate, SOAPAction: get, User-Agent: bw_console 
 (AwApi-Ruby/0.9.3, Common-Ruby/0.9.3, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, 
 curb), Authorization: Bearer ya29.AHxXh6zvQ, Content-Type: 
 text/xml;charset=UTF-8, Content-Length: 837
 ?xml version=1.0 encoding=UTF-8?env:Envelope xmlns:xsd=
 http://www.w3.org/2001/XMLSchema; xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance; xmlns:wsdl=
 https://adwords.google.com/api/adwords/cm/v201302; xmlns:env=
 http://schemas.xmlsoap.org/soap/envelope/;env:Headerwsdl:RequestHeader 
 xmlns=https://adwords.google.com/api/adwords/cm/v201302;userAgentconsole
  
 (AwApi-Ruby/0.9.3, Common-Ruby/0.9.3, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, 
 curb)/userAgentdeveloperTokenh6Axxxweg/developerToken/wsdl:RequestHeader/env:Headerenv:Bodyget
  
 xmlns=https://adwords.google.com/api/adwords/cm/v201302
 serviceSelectorfieldsId/fieldsfieldsName/fieldsfieldsStatus/fieldsorderingfieldName/fieldsortOrderASCENDING/sortOrder/ordering/serviceSelector/get/env:Body/env:Envelope
 HTTPI executes HTTP POST using the curb adapter
 SOAP response (status 500):
 soap:Envelope 
 xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;soap:HeaderResponseHeader
  
 xmlns=https://adwords.google.com/api/adwords/cm/v201302;requestId0004e1e1b8b62a800aed881c1a3b/requestIdserviceNameCampaignService/serviceNamemethodNameget/methodNameoperations0/operationsresponseTime23/responseTimeunits0/units/ResponseHeader/soap:Headersoap:Bodysoap:Faultfaultcodesoap:Server/faultcodefaultstring[AuthenticationError.OAUTH_TOKEN_INVALID
  
 @ ; trigger:'lt;nullgt;']/faultstringdetailApiExceptionFault xmlns=
 https://adwords.google.com/api/adwords/cm/v201302;message[AuthenticationError.OAUTH_TOKEN_INVALID
  
 @ ; 
 trigger:'lt;nullgt;']/messageApplicationException.TypeApiException/ApplicationException.Typeerrors
  
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
 xsi:type=AuthenticationErrorfieldPath/fieldPathtriggerlt;nullgt;/triggererrorStringAuthenticationError.OAUTH_TOKEN_INVALID/errorStringApiError.TypeAuthenticationError/ApiError.TypereasonOAUTH_TOKEN_INVALID/reason/errors/ApiExceptionFault/detail/soap:Fault/soap:Body/soap:Envelope
 Content-Type: text/xml; charset=UTF-8, Date: Fri, 19 Jul 2013 18:44:49 
 GMT, Expires: Fri, 19 Jul 2013 18:44:49 GMT, Cache-Control: private, 
 max-age=0, X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN, 
 X-XSS-Protection: 1; mode=block, Server: GSE, 

Re: Can't reuse oauth2 token - gives me OAUTH_TOKEN_INVALID (Ruby client lib)

2013-07-19 Thread Matthew Ledom
I assume Temla that you have since got your code to work. Did you ever 
figure out what the cause was? I'm experiencing the same issue now. I have 
updated the gem to the latest. When I authorize I get a new token and we as 
some other info but when I got to use the token I get the same 
error: OAUTH_TOKEN_INVALID

On Wednesday, August 8, 2012 11:15:20 AM UTC-4, Danial Klimkin wrote:

 Hello Temla,


 What version on google-ads-common are you using? Please try the same code 
 with the latest ads-common from git.

 See this issue which was recently closed:

   http://code.google.com/p/google-api-ads-ruby/issues/detail?id=80


 -Danial, AdWords API Team.


 On Wednesday, August 8, 2012 6:44:09 PM UTC+4, Temla wrote:


 Hi,

 I'm using the Ruby client library and I have studied the v201206 example 
 named use_oauth2.rb and also the adwords_on_rails application. I can't 
 figure out how
 to reuse the given token without getting OAUTH_TOKEN_INVALID error.

 Since it's hard to put a finger on the problem I'm going to post a link 
 with my code snippet, config file and the error message.
 http://pastie.org/private/diuetveogwzlveae5oeaq

 All thoughts and hints are appreciated

 Regards 



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

--- 
You received this message because you are subscribed to the Google Groups 
AdWords API Forum group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




OAUTH_TOKEN_INVALID ruby client

2013-07-19 Thread Matthew Ledom
I keep receiving this error when I try to use a service. In this instance 
I'm use the campaign service. I had everything working with ClientLogin and 
found that Reports are only supported with OAUTH2 so I'm trying to get that 
implemented.

I have setup my app to retrieve a offline token via the browser redirect 
work flow. I have also setup my adword model to request a new access token 
using the provided refresh token from the previous step. I can take that 
token and use it in the following code:

api.authorize(:oauth2_token = token )

where token:
{access_token=ya29.AxxxXh6zvQ,
 token_type=Bearer,
 expires_in=3600,
 id_token=
  eyJhbxxxB3MO4}

this returns:
{:access_token=ya29.AHEJXh6zvQ,
 :refresh_token=nil,
 :issued_at=2013-07-19 14:56:06 -0400,
 :expires_in=3600,
 :id_token=
  eyJhbxxxLB3MO4}

When I use this api object to call the campaign service I get the output 
provided below. The reporting download is the final piece needed to 
approval and I've searched all over this group and the web and can't find 
anything that helps. I'm using the latest versions of the ruby gem: 
google-ads-common (0.9.3) and google-adwords-api (0.9.3) 

SOAP request: 
https://adwords.google.com/api/adwords/cm/v201302/CampaignService
Accept-Encoding: gzip,deflate, SOAPAction: get, User-Agent: bw_console 
(AwApi-Ruby/0.9.3, Common-Ruby/0.9.3, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, 
curb), Authorization: Bearer ya29.AHxXh6zvQ, Content-Type: 
text/xml;charset=UTF-8, Content-Length: 837
?xml version=1.0 encoding=UTF-8?env:Envelope 
xmlns:xsd=http://www.w3.org/2001/XMLSchema; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xmlns:wsdl=https://adwords.google.com/api/adwords/cm/v201302; 
xmlns:env=http://schemas.xmlsoap.org/soap/envelope/;env:Headerwsdl:RequestHeader
 
xmlns=https://adwords.google.com/api/adwords/cm/v201302;userAgentconsole 
(AwApi-Ruby/0.9.3, Common-Ruby/0.9.3, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, 
curb)/userAgentdeveloperTokenh6Axxxweg/developerToken/wsdl:RequestHeader/env:Headerenv:Bodyget
 
xmlns=https://adwords.google.com/api/adwords/cm/v201302;serviceSelectorfieldsId/fieldsfieldsName/fieldsfieldsStatus/fieldsorderingfieldName/fieldsortOrderASCENDING/sortOrder/ordering/serviceSelector/get/env:Body/env:Envelope
HTTPI executes HTTP POST using the curb adapter
SOAP response (status 500):
soap:Envelope 
xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;soap:HeaderResponseHeader
 
xmlns=https://adwords.google.com/api/adwords/cm/v201302;requestId0004e1e1b8b62a800aed881c1a3b/requestIdserviceNameCampaignService/serviceNamemethodNameget/methodNameoperations0/operationsresponseTime23/responseTimeunits0/units/ResponseHeader/soap:Headersoap:Bodysoap:Faultfaultcodesoap:Server/faultcodefaultstring[AuthenticationError.OAUTH_TOKEN_INVALID
 
@ ; trigger:'lt;nullgt;']/faultstringdetailApiExceptionFault 
xmlns=https://adwords.google.com/api/adwords/cm/v201302;message[AuthenticationError.OAUTH_TOKEN_INVALID
 
@ ; 
trigger:'lt;nullgt;']/messageApplicationException.TypeApiException/ApplicationException.Typeerrors
 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:type=AuthenticationErrorfieldPath/fieldPathtriggerlt;nullgt;/triggererrorStringAuthenticationError.OAUTH_TOKEN_INVALID/errorStringApiError.TypeAuthenticationError/ApiError.TypereasonOAUTH_TOKEN_INVALID/reason/errors/ApiExceptionFault/detail/soap:Fault/soap:Body/soap:Envelope
Content-Type: text/xml; charset=UTF-8, Date: Fri, 19 Jul 2013 18:44:49 GMT, 
Expires: Fri, 19 Jul 2013 18:44:49 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
AdwordsApi::V201302::CampaignService::ApiException: 
[AuthenticationError.OAUTH_TOKEN_INVALID @ ; trigger:'null']

Thank you to anyone that can help. I really need to get this integration 
completed.

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

--- 
You received this message because you are subscribed to the Google Groups 
AdWords API Forum group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Can't reuse oauth2 token - gives me OAUTH_TOKEN_INVALID (Ruby client lib)

2012-08-08 Thread Temla

Hi,

I'm using the Ruby client library and I have studied the v201206 example 
named use_oauth2.rb and also the adwords_on_rails application. I can't 
figure out how
to reuse the given token without getting OAUTH_TOKEN_INVALID error.

Since it's hard to put a finger on the problem I'm going to post a link 
with my code snippet, config file and the error message.
http://pastie.org/private/diuetveogwzlveae5oeaq

All thoughts and hints are appreciated

Regards 

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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: Can't reuse oauth2 token - gives me OAUTH_TOKEN_INVALID (Ruby client lib)

2012-08-08 Thread Danial Klimkin
Hello Temla,


What version on google-ads-common are you using? Please try the same code 
with the latest ads-common from git.

See this issue which was recently closed:

  http://code.google.com/p/google-api-ads-ruby/issues/detail?id=80


-Danial, AdWords API Team.


On Wednesday, August 8, 2012 6:44:09 PM UTC+4, Temla wrote:


 Hi,

 I'm using the Ruby client library and I have studied the v201206 example 
 named use_oauth2.rb and also the adwords_on_rails application. I can't 
 figure out how
 to reuse the given token without getting OAUTH_TOKEN_INVALID error.

 Since it's hard to put a finger on the problem I'm going to post a link 
 with my code snippet, config file and the error message.
 http://pastie.org/private/diuetveogwzlveae5oeaq

 All thoughts and hints are appreciated

 Regards 


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