Hi Blake,

Please try config like this:

token_hash = {
   :access_token => ACCESS_TOKEN_FROM_SAMPLE_APP,
   :refresh_token => REFRESH_TOKEN_FROM_SAMPLE_APP,
   :issued_at => 1388190331,
   :expires_in => 3600
 }


-Danial, AdWords API Team.

On Saturday, December 28, 2013 4:44:04 AM UTC+4, Blake Howe wrote:
>
>
> Hi guys, Im sorry for yet another question. Ive spent  hours trying to get 
> this work and just seem to be going in circles.
>
> First of all I can get the sample app working fine, but what I am doing 
> requires offline access. Ive tried a couple of things 
>
> 1. just running the sample app getting the refresh token and plugging it 
> in, but I get invalid token. Here is the sample code:
>
>
> token_hash = {
>    :access_token => ACCESS_TOKEN_FROM_SAMPLE_APP,
>    :refresh_token => REFRESH_TOKEN_FROM_SAMPLE_APP,
>    :expires_in => 3600,
>    :expires_at => 1388190331,
>    :params => { "token_type"=>"Bearer"},
>    :options => { :mode => :header, :header_format => "Bearer %s", 
> :param_name=>"bearer_token" }
>  }
>  
>  binding.pry
>  # Setup new adwords class and service
>  adwords = AdwordsApi::Api.new;
>  adwords.logger = Logger.new('adwords_xml.log')
>  adwords.credential_handler.set_credential(:oauth2_token, token_hash)
>  adwords.credential_handler.set_credential(:client_customer_id, 
> CUSTOMER_ID_OF_ACCOUNT)
>  campaign_srv = adwords.service(:CampaignService,:v201309)
>  response = campaign_srv.get({:fields => ['Id', 'Name', 'Status']})
>  p response[:total_num_entries]
>
> When I run it I get invalid token. Attached is the debugging output 
> in adwords_xml_for_refresh_token.log
>
> Thanks in advance,
> Blake
>
>
>

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

Reply via email to