`generate_access_token': AdsCommon::Errors::OAuth2VerificationRequired (AdsCommon::Errors::OAuth2VerificationRequired)

2013-12-19 Thread jroigarderiu
Hi,

I am using the Ruby gem. When trying to do an API call I keep getting the 
error that I showed in the title.

In the docs of the Wiki and the Youtube screencast it is not shown what 
should we do in order to get the access from the User. Could you please 
tell me what am I missing here?

require 'adwords_api'

class Client
  def initialize
@adwords = AdwordsApi::Api.new({
  :authentication = {
:method = 'OAuth2',
:oauth2_client_id = '',
:oauth2_client_secret = 'xxx',
:developer_token = 'xxx',
:client_customer_id = '5',
:user_agent = 'Ruby Sample'
  },
  :service = {
:environment = 'Production'
  }
})
  end

  def get_service(name, version)
return @adwords.service(name, version)
  end
end

client = Client.new
campaign_srv = client.get_service(:CampaignService, nil)
campaigns = campaign_srv.get({:fields = ['Id', 'Name', 'Status']})


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: `generate_access_token': AdsCommon::Errors::OAuth2VerificationRequired (AdsCommon::Errors::OAuth2VerificationRequired)

2013-12-19 Thread Danial Klimkin
Hi,


For OAuth2 authorization you need a verification code in order to obtain 
the refresh token. Please see this code as an example:

  
https://github.com/googleads/google-api-ads-ruby/blob/master/adwords_api/examples/v201309/misc/setup_oauth2.rb


-Danial, AdWords API Team.


On Thursday, December 19, 2013 4:28:10 AM UTC+4, jroiga...@gmail.com wrote:

 Hi,

 I am using the Ruby gem. When trying to do an API call I keep getting the 
 error that I showed in the title.

 In the docs of the Wiki and the Youtube screencast it is not shown what 
 should we do in order to get the access from the User. Could you please 
 tell me what am I missing here?

 require 'adwords_api'

 class Client
   def initialize
 @adwords = AdwordsApi::Api.new({
   :authentication = {
 :method = 'OAuth2',
 :oauth2_client_id = '',
 :oauth2_client_secret = 'xxx',
 :developer_token = 'xxx',
 :client_customer_id = '5',
 :user_agent = 'Ruby Sample'
   },
   :service = {
 :environment = 'Production'
   }
 })
   end

   def get_service(name, version)
 return @adwords.service(name, version)
   end
 end

 client = Client.new
 campaign_srv = client.get_service(:CampaignService, nil)
 campaigns = campaign_srv.get({:fields = ['Id', 'Name', 'Status']})




-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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.