salesforce-marketingcloud / FuelSDK-Ruby

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

[BUG] - 400 response when inserting or updating Data Extension rows #135

Open mghadley opened 1 year ago

mghadley commented 1 year ago

Describe the bug A few months ago, we started receiving 400s when doing a post on ::MarketingCloudSDK::DataExtension::Row. The only message we get with the response is Bad Request. I did notice that this gem has not been updated in a while, does it just need to be updated?

To Reproduce

def auth_client
   ::MarketingCloudSDK::Client.new(
      "client" => {
        "id" => @salesforce_profile.client_id,
        "secret" => @salesforce_profile.client_secret
     },
     "request_token_url" => "#{@salesforce_profile.tenant_endpoint}.auth.marketingcloudapis.com/v1/requestToken",
     "defaultwsdl" => "#{@salesforce_profile.tenant_endpoint}.soap.marketingcloudapis.com/etframework.wsdl"
   )
 end

row_client = ::MarketingCloudSDK::DataExtension::Row.new
row_client.authStub = auth_client
row_client.filter = nil
      row_client.props =
        {
          # We are hard coding in the column names here based off of the hard coded data extension above.
          # This code will need to be fixed to use the column_names method above and then update based off of those
          "CampaignExpirationDate" => offer.campaign.end_time,
          "CampaignName" => offer.campaign.name,
          "CampaignGuid" => offer.campaign.guid,
          "LastDismissDate" => offer.dismissed_at,
          "LastImpressionDate" => offer.viewed_at,
          "FirstImpressedAt" => offer.first_viewed_at,
          "FistClickedAt" => offer.first_clicked_at,
          "LastClickDate" => offer.clicked_at,
          "BannerActivationDate" => offer.created_at,
          "SubscriberKey" => subscriber_key,
          "FirstViewedAt" => offer.first_viewed_at,
          "LastViewDate" => offer.viewed_at,
          "MobileBannerName" => mobile_banner_name,
          "JourneyName" => journey_name,
          "ViewCount" => offer.impression_count.to_s,
          "ImpressionCount" => offer.impression_count.to_s,
          "CampaignPriority" => offer.campaign.priority.to_s,
        }
      @row_response = row_client.post

Expected behavior A successful response

Environment

The bug has the severity

davideroberts commented 1 year ago

Upon further discovery, we have determined this issue is not to be a bug with FuelSDK-Ruby but caused by a bug in Savon 1.13.0 and has been fixed in 1.14.0. For anyone experiencing something similar you can downgrade to 1.12.1 or upgrade to 1.14.0 (requires Ruby 2.7).

yoonwaiyan commented 1 year ago

@davideroberts I think you meant 2.x not 1.x, but you saved my day šŸŽ‰ šŸŽ‰ šŸŽ‰ I had no idea why the requests were bad request and I thought it has something to do with our configuration but I didn't expect it to be coming from savon gem. Thanks so much!