I'm getting a bizarre error attempting to retrieve my campaigns from the ET Marketing Cloud using the fuel sdk in ruby.

Following the default example used for List retrieval, it's working correctly:

client = FuelSDK::Client.new({'client'=> { 'id' => EXACTTARGET_CLIENT_ID, 'secret' => EXACTTARGET_CLIENT_SECRET }})

    list = FuelSDK::List.new
    list.client = client
    response = list.get

gives me a response like so:

[{:client=>{:id=>"XXXXXXX"}, :partner_key=>nil, :created_date=>Mon, 12 Jan 2015 17:01:13 +0000, :modified_date=>Mon, 12 Jan 2015 17:01:13 +0000, :id=>"4402", :object_id=>"bea2b746-7a03-4a50-9c94-ff89f387d443", :customer_key=>"All Subscribers - 52047", :list_name=>"All Subscribers", :category=>"52047", :type=>"Private", :description=>"Contains all subscribers", :list_classification=>"ExactTargetList", :"@xsi:type"=>"List"}]

However, if I try to use the given example for Campaigns:

campaign = FuelSDK::Campaign.new 
campaign.authStub = client #(NB: authStub or client? same error either way)
response = campaign.get

I'm immediately greeted with the following:

undefined method 'keys' for [{"id"=>""}]:Array

I'm pulling my hair out over this one, can anyone help me understand why this is happening for campaigns (and only campaigns?!)


  • 1
    Taking a look at this tonight - I'll see what I can uncover. Welcome to SFSE! – Kelly J Andrews Jan 26 '15 at 21:13

You will need to build out the gem using the following command:

gem build fuelsdk.gemspec

Then install

gem install fuelsdk-0.0.5.gem

This should provide an up-to-date version with campaign support.

  • 1
    Pulling the .9 Refactor seems to be working correctly for campaigns. I'm going to cross-reference this with master, do some playing around, and then submit a pull request later. Thanks for your help! – Mike P. Jan 30 '15 at 23:07
  • Glad I could get you past it – Kelly J Andrews Jan 30 '15 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.