1

The documentation for the FuelSDK-Ruby gem says that you can use the Put method to do an upsert. However, this method doesn't appear to be implemented. Is there a way to do an upsert using the FuelSDK-Ruby gem?

Here's what the wiki says:

Support for single request to Add/Update:A single request can be made which will create the object if one doesn't already or update one if it does. This works for Subscriber, DataExtension::Row, and List objects using the Put method.

5
  • I think you are right - it's not been implemented, or if it was it's no longer there. At this point, it would require the SDK to be altered, and it's currently under community support - and would require a pull request to get updated. Dec 29 '14 at 19:54
  • @KellyJAndrews So is ExactTarget completely passing maintenance and future development of the gem on to the community going forward? I think that would be unfortunate, but if that's the case, I think it needs to be handed over to someone who will at least oversee it. Currently there are numerous issues that have went unanswered for over a year. Nobody is going to take the time to make significant contributions if those contributions aren't being considered for inclusion in a timely manner. Dec 30 '14 at 3:35
  • Not entirely no, just at the moment its been somewhat set on low priority. I'm actively trying to resolve this to provide better ruby support ongoing. Dec 30 '14 at 3:40
  • @KellyJAndrews That would be fantastic. Is there currently any workaround to do an upsert from Ruby? Dec 30 '14 at 3:48
  • I'm going to try a few things - might try adding the functionality if I can manage it :) Dec 30 '14 at 7:37
0

It looks as though this has been implemented - but it's on a different version than the "official" gem listed at https://rubygems.org/gems/fuelsdk

If you clone the repo for the fuelsdk here - https://github.com/ExactTarget/FuelSDK-Ruby

And then perform gem build fuelsdk.gemspec

Once it's built install using - gem install fuelsdk-0.0.5.gem

Using this gem - you should have access to the put() funtionality.

Sample Call

require 'fuelsdk'

@auth = {
    'client' => {
        'id' => 'CLIENT ID',
        'secret' => 'CLIENT SECRET'
    }
}

stubObj = FuelSDK::Client.new @auth,true

 sub = FuelSDK::Subscriber.new
 sub.authStub = stubObj
 sub.properties = {
    "EmailAddress" => "test2@bh.email.com",
    "SubscriberKey" => "test2@bh.email.com"
 }
sub.put

row = FuelSDK::DataExtension::Row.new
row.customer_key = "test-de";
row.authStub = stubObj
row.properties = {"ID" => "7", "text" => "sample"}
row.put

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.