I'm using the API using my own credentials - using the installed 
application flow.

This is the code I use :


----

# Creates an instance of AdWords API class. Uses a configuration file and
  # Rails config directory.
  def create_adwords_api()
    @api = AdwordsApi::Api.new({
            :authentication => {
              :method => 'OAuth2',
              :oauth2_client_id => 'XXX' ,
              :oauth2_client_secret => 'XXX',
              :developer_token => 'XXX',
              :client_customer_id => '843-812-3425',
              :user_agent => ""
            },
            :oauth2_token  => {
              :access_token => 'XXX' 
            },
            :service => {
              :environment => 'PRODUCTION'
            }
          })
    return @api
  end


--


THanks

Arjun

On Saturday, 10 February 2018 04:27:41 UTC+5:30, Arjun Rajkumar wrote:
>
> Hey all, 
>
> I'm trying to use the Adwords API Library but running into this error:
>
> --
> AdsCommon::Errors::OAuth2VerificationRequired excluded from capture: DSN 
> not set
>
> AdsCommon::Errors::OAuth2VerificationRequired 
> (AdsCommon::Errors::OAuth2VerificationRequired):
>
> --
>
> I ran the 'ruby setup_oauth2.rb' - to get the verification code - and it 
> automatically modified my adwords_api.yml file. 
> I entered the verification code in the terminal - and it updated the 
> adwords_api.yml file.
>
>
> I'm running the code on this while getting the error - 
> https://github.com/googleads/google-api-ads-ruby/blob/master/adwords_api/README.md
>
> campaign_srv = adwords.service(:CampaignService, :v201708)
>
> campaigns = campaign_srv.get({:fields => ['Id', 'Name', 'Status']})
>
>
> Can anyone help with. I'm stuck on this for a few hours.
>
> Thanks, 
>
> Arjun
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/9ec6aad2-2558-4e54-a11b-925cce08bb1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to