Hello Sudhir,

Please check out the discussion on this issue:

  http://code.google.com/p/google-api-ads-ruby/issues/detail?id=85&can=1

Note when using a pre-saved token, it should be a hash. I'll update the 
OAuth2 example to make it more clear.


-Danial, AdWords API Team.


On Thursday, October 18, 2012 1:28:26 AM UTC+4, Sudhir wrote:
>
> get_campaigns and get_account_hierarchy examples are provided in the ruby 
> libraray itself. The only difference is the authentication. I am using 
> OAuth2 and examples use ClientLogin so the the difference is in config file 
> only.
>
> Here is my config:
>
> ---
> # This is an example configuration file for the AdWords API client library.
> # Please fill in the required fields, and copy it over to your home 
> directory.
> :authentication:
>   :method: OAuth2
>
>   :oauth2_client_id: 
> 2234XXXXXXXXXX844-juj2XXXXXXXXXba3dl00icqlq.apps.googleusercontent.com
>   :oauth2_client_secret: XXXXXXXXXXXXXXX
>   :developer_token: san...@gmail.com <javascript:>++usa
>   #:client_customer_id:
>   :user_agent: 'Click downloader'
> :service:
>   :environment: SANDBOX
> :connection:
>   :enable_gzip: false
> :library:
>   :log_level: INFO
>
>
> On Tuesday, October 16, 2012 8:05:40 AM UTC-5, Danial Klimkin wrote:
>>
>> Hello Sudhir,
>>
>>
>> Can you please provide your source code for both get_campaigns and 
>> get_account_hierarchy? What set of the credentials do you provide?
>>
>>
>> -Danial, AdWords API Team.
>>
>>
>> On Thursday, October 11, 2012 10:27:01 PM UTC+4, Sudhir wrote:
>>>
>>> I followed the documentation to set up google-api-ads-ruby and run examples 
>>> by first calling get campaigns to create clients but I am getting an error 
>>> when trying to run get_account_hierarchy.rb
>>>
>>> #<struct Faraday::Request method=:post, 
>>> path="https://accounts.google.com/o/oauth2/token";, params={}, 
>>> headers={"Content-Type"=>"application/x-www-form-urlencoded"}, 
>>> body={"grant_type"=>"authorization_code", 
>>> "code"=>"4/f7akIdRJIYp9wkMTYfKFSLbdD.something", 
>>> "client_id"=>"someclientid.apps.googleusercontent.com", 
>>> "client_secret"=>"veryseceret", 
>>> :redirect_uri=>"urn:ietf:wg:oauth:2.0:oob"}, options={:proxy=>nil}>
>>>
>>> OAuth2::Error: invalid_grant: 
>>> {
>>>   "error" : "invalid_grant"
>>> }
>>>
>>>
>>>
>>>

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

Reply via email to