Never mind. It turns out the service was temporarily unavailable. Would've 
been nice to get an error saying so, though...




On Sunday, June 21, 2015 at 4:47:18 PM UTC+3, Johnny wrote:
>
> I successfully created an experiment for my account. Now I'm trying to 
> create an experiment with the ruby client library (the code I used is 
> below). But I keep getting:
>
> AdwordsApi::V201409::ExperimentService::ApiException: 
> AdwordsApi::V201409::ExperimentService::ApiException
> from 
> /home/johnny/.rvm/gems/ruby-2.2.0/gems/google-ads-common-0.9.8/lib/ads_common/savon_service.rb:113:in
>  
> `handle_errors'
> from 
> /home/johnny/.rvm/gems/ruby-2.2.0/gems/google-ads-common-0.9.8/lib/ads_common/savon_service.rb:83:in
>  
> `execute_action'
> from 
> /home/johnny/.rvm/gems/ruby-2.2.0/gems/google-adwords-api-0.13.2/lib/adwords_api/v201409/experiment_service.rb:25:in
>  
> `mutate'
> from (irb):45
> from /home/johnny/.rvm/rubies/ruby-2.2.0/bin/irb:11:in `<main>'
>
> How do I interpret this error?
>
> My code:
>
> gem 'google-adwords-api', '0.13.2'
> require 'adwords_api'
> require 'time'
>
> adwords = AdwordsApi::Api.new({ :authentication => { :method => 'OAuth2', 
> :oauth2_client_id => 'client_id', :oauth2_client_secret => 'secret', 
> :oauth2_callback => 'callback', :developer_token => 'sometoken', 
> :user_agent => 'UA' }, :service => { :environment => 'PRODUCTION' } })
>
> token = {:access_token=>"atoken", :refresh_token=>"rtoken", 
> :issued_at=>Time.parse('2015-06-21 15:17:30'), :expires_in=>3600, 
> :id_token=>nil}
>
> adwords.credential_handler.set_credential(:oauth2_token, token)
> adwords.credential_handler.set_credential(:client_customer_id, 'cid')
>
> experiment_srv = adwords.service(:ExperimentService, API_VERSION)
> operation = {   :operator => 'ADD',   :operand => {     :campaign_id => 
> '11111111',     :name => "Interplanetary Experiment #%d" % (Time.new.to_f * 
> 1000).to_i,     :query_percentage => 10,     :start_date_time => 
> Time.now.strftime('%Y%m%d %H%M%S'),     :status => 'ENABLED',     
> :end_date_time =>        DateTime.parse((Date.today + 
> 30).to_s).strftime('%Y%m%d %H%M%S')   } }
> response = experiment_srv.mutate([operation])
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/18eb37e0-267d-4aa2-b5cd-6fe90b7bf922%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to