salesforce-marketingcloud / FuelSDK-Ruby

Fuel SDK for Ruby
BSD 3-Clause "New" or "Revised" License
52 stars 155 forks source link

Getting 'Require Client Id and Client Secret to refresh tokens' while running sample code #37

Open aniruddha84 opened 9 years ago

aniruddha84 commented 9 years ago

Am I missing something? Created an App for s1.q1 in Appcenter and tried sample executing code in irb

Code

require 'fuelsdk'

myClient = FuelSDK::Client.new auth_hash dataextensionrow = FuelSDK::DataExtension::Row.new dataextensionrow.authStub = myClient dataextensionrow.Name = 'ExampleDEName' dataextensionrow.props = ['FirstName', 'LastName', 'AnotherColumnName'] response = dataextensionrow.get

Error:

RuntimeError: Require Client Id and Client Secret to refresh tokens from /Users/adeshpande/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fuelsdk-0.0.5/lib/fuelsdk/client.rb:114:in block in refresh' from /Users/adeshpande/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fuelsdk-0.0.5/lib/fuelsdk/client.rb:113:insynchronize' from /Users/adeshpande/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fuelsdk-0.0.5/lib/fuelsdk/client.rb:113:in refresh' from /Users/adeshpande/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fuelsdk-0.0.5/lib/fuelsdk/soap.rb:138:insoap_client' from /Users/adeshpande/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fuelsdk-0.0.5/lib/fuelsdk/soap.rb:276:in soap_request' from /Users/adeshpande/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fuelsdk-0.0.5/lib/fuelsdk/soap.rb:219:insoap_get' from /Users/adeshpande/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fuelsdk-0.0.5/lib/fuelsdk/objects.rb:43:in get' from /Users/adeshpande/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fuelsdk-0.0.5/lib/fuelsdk/objects.rb:457:inget'

stevepm commented 8 years ago

I'm getting the same issue. Any updates on this?

dalton-cole commented 6 years ago

Try:

auth_hash = { 'client' => { 'id' => clientId, 'secret' => secret }}
myClient = MarketingCloudSDK::Client.new client

I was getting the same issue because I had my auth_hash malformed.