FuelSDK-Ruby
FuelSDK-Ruby copied to clipboard
Getting 'Require Client Id and Client Secret to refresh tokens' while running sample code
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:in
synchronize'
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:in
soap_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:in
soap_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:in
get'
I'm getting the same issue. Any updates on this?
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.