salesforce-marketingcloud / fuelsdk-ruby Goto Github PK
View Code? Open in Web Editor NEWFuel SDK for Ruby
License: BSD 3-Clause "New" or "Revised" License
Fuel SDK for Ruby
License: BSD 3-Clause "New" or "Revised" License
We're developing a gem that uses FuelSDK. We can't specify this repo in the gemspec, since the https://github.com/barberj/fuelsdk fork is what's on RubyGems. Can you put your gem on RubyGems?
I think Justin Barber created his fork due to lack of activity on this repo. Would you be willing to merge his fork back into the official repo?
This seems like a bug, but perhaps I'm thinking about it incorrectly. success
is determined by the message returned with a request.
def unpack raw
...
@success = @message == 'OK'
end
However, if the number of results exceeds the page size, the message returned is not OK
it's MoreDataAvailable
. The request itself was successful, so it seems wrong to say that success = false
.
Have these been implemented?
PHP equivalent Reference: https://github.com/ExactTarget/FuelSDK-PHP/blob/Dot9/ET_Client.php#L1289-L1354
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
While creating a subscriber I am getting error code 12018 from ET. Can you please let me know what does it mean?
Or How can I get a sample SOAP envelope that this gem creates while sending request?
Hi Team,
I have created a DataExtension in MarketingCloud i.e SurveyDetails which has below fields-
SurveyID
SurveyDescription
CreatedAt
I want to delete Some SurveyID from this Data Extension. let's say want to delete SurveyID='S0001'. Could you please help me how I can delete this records through marketing Cloud APi. I went through below portal but didn't help much as it's referring only contact object.
Regards,
Puneet Gaur
Hi,
I am trying to add a row in a data extension I have created following the sample-dataextension.rb
Add a row to a data extension (using CustomerKey). I keep on having the same error:
ECONNRESET: Connection reset by peer - SSL_connect
Here is the code I run from a rails console:
CLIENT_ID = "%OUR_CLIENT_ID%"
SECRET = "%OUR_SECRET%"
DE_CUSTOMER_KEY = "%OUR_DE_CUSTOMER_KEY%"
de_row_proerties = {"de_attribute" => "value"}
auth = {
"client" => {
"id" => CLIENT_ID,
"secret" => SECRET
},
"defaultwsdl" => "https://webservice.s7.exacttarget.com/etframework.wsdl"
}
stubObj = ET_Client.new auth, true
de = ET_DataExtension::Row.new
de.CustomerKey = DE_CUSTOMER_KEY
de.authStub = stubObj
de.props = de_row_proerties
de.post
Here is the error I get (with the debug mode enabled) :
D, [2017-05-18T17:13:24.193758 #9943] DEBUG -- : HTTPI GET request to webservice.s7.exacttarget.com (httpclient)
D, [2017-05-18T17:13:24.487087 #9943] DEBUG -- : HTTPI GET request to webservice.s7.exacttarget.com (httpclient)
Errno::ECONNRESET: Connection reset by peer - SSL_connect
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:303:in `connect'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:303:in `ssl_connect'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:760:in `block in connect'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/2.2.0/timeout.rb:98:in `call'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/2.2.0/timeout.rb:98:in `timeout'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/2.2.0/timeout.rb:124:in `timeout'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:751:in `connect'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:609:in `query'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:164:in `query'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:1083:in `do_get_block'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:887:in `block in do_request'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:981:in `protect_keep_alive_disconnected'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:886:in `do_request'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:774:in `request'
from /Users/bensotty/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/httpi-2.0.2/lib/httpi/adapter/httpclient.rb:26:in `request'
I am running a project on rails 4.2.7.1, on my local machine, mac os 10.12.3, using OpenSSL 1.0.2k.
Any ideas ? Is this a bug on the sdk ?
Thanks for helping.
Currently when running the SDK with Savon 2.3.0, it results in an error stating "APIObject not found".
I have a simple Sinatra/Sidekiq app hosted on Heroku that uses FuelSDK::TriggeredSend
, and it has been running without issue for several months. On March 2nd, it began giving me an error related to SSL_connect (certificate error):
2016-03-16T23:54:34.096396+00:00 app[worker.1]: 2016-03-16T23:54:34.096Z 3 TID-ow8ih16fo WARN: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
2016-03-16T23:54:34.096459+00:00 app[worker.1]: 2016-03-16T23:54:34.096Z 3 TID-ow8ih16fo WARN: /app/vendor/bundle/ruby/2.3.0/gems/httpi-2.0.2/lib/httpi/adapter/net_http.rb:36:in `rescue in request'
2016-03-16T23:54:34.096461+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/httpi-2.0.2/lib/httpi/adapter/net_http.rb:27:in `request'
2016-03-16T23:54:34.096462+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/httpi-2.0.2/lib/httpi.rb:137:in `request'
2016-03-16T23:54:34.096463+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/httpi-2.0.2/lib/httpi.rb:109:in `post'
2016-03-16T23:54:34.096463+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/savon-2.2.0/lib/savon/operation.rb:67:in `call!'
2016-03-16T23:54:34.096464+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/savon-2.2.0/lib/savon/operation.rb:49:in `call'
2016-03-16T23:54:34.096465+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/savon-2.2.0/lib/savon/client.rb:36:in `call'
2016-03-16T23:54:34.096466+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/bundler/gems/FuelSDK-Ruby-7994480f7854/lib/fuelsdk/soap.rb:276:in `soap_request'
2016-03-16T23:54:34.096466+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/bundler/gems/FuelSDK-Ruby-7994480f7854/lib/fuelsdk/soap.rb:269:in `soap_cud'
2016-03-16T23:54:34.096467+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/bundler/gems/FuelSDK-Ruby-7994480f7854/lib/fuelsdk/soap.rb:223:in `soap_post'
2016-03-16T23:54:34.096468+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/bundler/gems/FuelSDK-Ruby-7994480f7854/lib/fuelsdk/objects.rb:398:in `send'
2016-03-16T23:54:34.096469+00:00 app[worker.1]: /app/exact_target_client.rb:37:in `triggered_send'
2016-03-16T23:54:34.096469+00:00 app[worker.1]: /app/submission_service.rb:24:in `perform'
2016-03-16T23:54:34.096470+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-3.3.4/lib/sidekiq/processor.rb:75:in `execute_job'
2016-03-16T23:54:34.096471+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-3.3.4/lib/sidekiq/processor.rb:52:in `block (2 levels) in process'
2016-03-16T23:54:34.096471+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-3.3.4/lib/sidekiq/middleware/chain.rb:127:in `block in invoke'
2016-03-16T23:54:34.096472+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-3.3.4/lib/sidekiq/middleware/server/retry_jobs.rb:74:in `call'
2016-03-16T23:54:34.096473+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-3.3.4/lib/sidekiq/middleware/chain.rb:129:in `block in invoke'
2016-03-16T23:54:34.096473+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-3.3.4/lib/sidekiq/middleware/server/logging.rb:15:in `block in call'
2016-03-16T23:54:34.096474+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-3.3.4/lib/sidekiq/logging.rb:24:in `with_context'
2016-03-16T23:54:34.096475+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-3.3.4/lib/sidekiq/middleware/server/logging.rb:11:in `call'
2016-03-16T23:54:34.096476+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-3.3.4/lib/sidekiq/middleware/chain.rb:129:in `block in invoke'
2016-03-16T23:54:34.096476+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-3.3.4/lib/sidekiq/middleware/chain.rb:132:in `invoke'
2016-03-16T23:54:34.096477+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-3.3.4/lib/sidekiq/processor.rb:51:in `block in process'
2016-03-16T23:54:34.096477+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-3.3.4/lib/sidekiq/processor.rb:98:in `stats'
2016-03-16T23:54:34.096478+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-3.3.4/lib/sidekiq/processor.rb:50:in `process'
2016-03-16T23:54:34.096479+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'
2016-03-16T23:54:34.096479+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send'
2016-03-16T23:54:34.096480+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:122:in `dispatch'
2016-03-16T23:54:34.096481+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'
2016-03-16T23:54:34.096481+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke'
2016-03-16T23:54:34.096482+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'
2016-03-16T23:54:34.096483+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize'
2016-03-16T23:54:34.096484+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'
I'm familiar with the reasons for the SSL_connect issue, but for the life of me, I can't seem to address this without setting Net::HTTP's verify_mode to OpenSSL::SSL::VERIFY_NONE
.
I suspect that something has changed on the Heroku side of things, but am curious to hear if you have any suggestions.
Would you be open to adding CI through Travis CI?
Would love to get everyones opinion - should we start from the beginning, or refactor what we have? Seems like a lot of issue keep popping up, and this is compatible with Ruby 1.9.3 - might be nice to support the latest Ruby version.
Any suggestions?
I'm making the following request from the docs:
myClient = FuelSDK::Client.new({'client' => { 'id' => CLIENTID, 'secret' => SECRET }})
list = FuelSDK::List.new
list.authStub = myClient
list.props = {"ListName" => "SDKList", "Description" => "SDK Created List"}
results = list.post
The response includes this body:
@body={:fault=>{:faultcode=>"q0:Security", :faultstring=>"Login failed", :faultactor=>"https://webservice.s7.exacttarget.com/Service.asmx"}}
What does this mean? Am I missing some configuration?
I've been able to get the ET_DataExtension get methods to work just fine, but using post fails with the following message:
"Requested value 'APIObject' was not found."
This happens both in my own code and in the supplied objsamples/sample-dataextension.rb test script.
I looked at the post method and found a large commented block of text with the comment "# FIX THIS" but this commented section seemed to be related to passing an array of values instead of a hash, and I've been using hashes with values mapped directly to the data extension's column names as returned by the Column get method.
Since the objsamples/sample-dataextension.rb script also fails on all post requests (and actually encounters a fatal error and crashes within the first half of the script) I'm guessing this error is related to a bug in the FuelSDK-Ruby library. Can you please advise on how I should proceed, or if you are able to fix this?
Can you please add tag 0.0.6 referencing following commit 72f97ab?
After transition to new repo our existing Gemfile reference stopped working.
Thanks in ahead.
I'm trying to do the simple task of creating a subscriber with attributes and adding him/her to a list.
This code works:
client = FuelSDK::Client.new({'client' => { 'id' => CLIENTID, 'secret' => SECRET }}, true)
subscriber = FuelSDK::Subscriber.new
subscriber.client = client
subscriber.properties = {
"EmailAddress" => '[email protected]',
"Lists" =>[{"ID" => LISTID}]
}
subscriber.post
But if I add a another custom property to subscriber.properties
, I get a FuelSDK::SoapResponse
with body Bad Request
. Neither of these work:
subscriber.properties = {
"EmailAddress" => '[email protected]',
"Full Name" => "John Doe", # Space separated key
"Lists" =>[{"ID" => LISTID}]
}
subscriber.properties = {
"EmailAddress" => '[email protected]',
"FullName" => "John Doe", # Camelcase key
"Lists" =>[{"ID" => LISTID}]
}
There is a sample file for profile attributes but it only shows how to create, update, and delete profile attributes. It doesn't say how to apply them to a subscriber.
Also, I should add that I made the following change to the gemspec to get it to work with our Rails 4 app:
spec.add_dependency "savon", '2.2.0'
spec.add_dependency "json" # used to be "~> 1.7.0"
spec.add_dependency "jwt" # used to be "~> 0.1.6"
There is an issue on decoding the JWT token with signature while initializing the MarketingCloudSDK::Client
where the decode method returns an array [payload, header]
but the code in the gem is accessing as hash which raises the error TypeError (no implicit conversion of String into Integer):
after line number 87.
The JWT gem version in jwt 1.5.4
I have fixed the issue and created a pull request #63 with the fix.
Whenever I try to run any of the samples, I receive the following error:
"Caught exception: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed"
Thoughts? @MichaelAllenClark
Please deprecate this repository, or give a full revamp.
Being a developer it's not pleasant at all to work with this code. Many common practices have not been followed. I've spent so much time already trying to debug this.
I am using Sidekiq for the background process and creat a very simple application to validate Sidekiq functionality. I am getting success response but getting failure message when calling it through sidekiq. Please help me resolve this issue.
Error Message :
2018-01-21T15:40:57.662Z 73625 TID-outayy7ac WARN: {"context":"Job raised exception","job":{"class":"ProcessWorker","args":["{"name"=>"Hello", "description"=>"Hello666", "author"=>"Hello"}"],"retry":true,"queue":"default","jid":"866561849a5cd5336ef03cc4","created_at":1516548964.76175,"enqueued_at":1516549257.6588979,"error_message":"When assigning attributes, you must pass a hash as an argument.","error_class":"ArgumentError","failed_at":1516548964.76448,"retry_count":3,"retried_at":1516549132.7047172},"jobstr":"{"class":"ProcessWorker","args":["{\"name\"=>\"Sumit8901\", \"description\"=>\"Hello666\", \"author\"=>\"Hello7777\"}"],"retry":true,"queue":"default","jid":"866561849a5cd5336ef03cc4","created_at":1516548964.76175,"enqueued_at":1516549257.6588979,"error_message":"When assigning attributes, you must pass a hash as an argument.","error_class":"ArgumentError","failed_at":1516548964.76448,"retry_count":3,"retried_at":1516549132.7047172}"}
2018-01-21T15:40:57.662Z 73625 TID-outayy7ac WARN: ArgumentError: When assigning attributes, you must pass a hash as an argument.
2018-01-21T15:40:57.662Z 73625 TID-outayy7ac WARN:
Please find the below code-
Controller class:
books_controller.rb
def create
@job=ProcessWorker.perform_async(book_params)
h = {"response" => {"job_id" => @job}}
render json: h
end
Worker Class:
class ProcessWorker
include Sidekiq::Worker
def perform(book_params)
book = Book.new(book_params)
book.save
end
end
Migrations Class:
class CreateBooks < ActiveRecord::Migration[5.1]
def change
create_table :books do |t|
t.string :name
t.string :description
t.string :author
t.timestamps
end
end
I'm using the fuelsdk gem and when I try to remove a data extension row I'm having a problem.
This is my code:
client = ET_Client.new auth
de_row = ET_DataExtension::Row.new()
de_row.authStub = client
de_row.CustomerKey = "XXXXXXXXXXXX"
de_row.props = {"Web_FIC" => fic}
response = de_row.delete
This is my error
TypeError: can't convert String into Integer
from /Users/raphaelpetegrosso/.rvm/gems/ruby-1.9.3-p484/gems/fuelsdk-0.1.7/lib/fuelsdk/objects.rb:220:in []=' from /Users/raphaelpetegrosso/.rvm/gems/ruby-1.9.3-p484/gems/fuelsdk-0.1.7/lib/fuelsdk/objects.rb:220:in
block in add_customer_key'
from /Users/raphaelpetegrosso/.rvm/gems/ruby-1.9.3-p484/gems/fuelsdk-0.1.7/lib/fuelsdk/objects.rb:218:in each' from /Users/raphaelpetegrosso/.rvm/gems/ruby-1.9.3-p484/gems/fuelsdk-0.1.7/lib/fuelsdk/objects.rb:218:in
add_customer_key'
from /Users/raphaelpetegrosso/.rvm/gems/ruby-1.9.3-p484/gems/fuelsdk-0.1.7/lib/fuelsdk/objects.rb:212:in delete' from (irb):37 from /Users/raphaelpetegrosso/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.17/lib/rails/commands/console.rb:47:in
start'
from /Users/raphaelpetegrosso/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.17/lib/rails/commands/console.rb:8:in start' from /Users/raphaelpetegrosso/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.17/lib/rails/commands.rb:41:in
<top (required)>'
from script/rails:6:in require' from script/rails:6:in
So I opened your gem and checked that the error was in this line:
d['CustomerKey'] = customer_key
but in my case d is an array and not a hash. Then I changed the code to this:
d << 'CustomerKey'
d << customer_key
And it worked, but my response came with this error:
status_message=>"Exception occurred during [Delete] ErrorID: 1913074240"
It seems that the gem version is not updated, right? Any idea what is the error?
Thanks
My company is switching to MarketingCloud and we are heavily depending on this SDK. I'd like to help maintain this gem, set up automated tests, and clean up the issue and PR queues. I am presently one of the maintainers of Capistrano, and have a number of years of experience maintaining Ruby applications.
Would any of the maintainers be willing to bring me on board with this?
Thanks!
~William Johnston
Software Engineer
Minnesota Public Radio/American Public Media
cc: @barberj (it looks like you've been doing work most recently, thanks!)
I'm calling soap_delete as follows:
fuelsdk_client.soap_delete("QueryDefinition", {"ObjectID" => my_object_id})
and receiving this error:
An entry with the customer key already exists
Here's the full error results hash:
{:status_code=>"Error", :status_message=>"An entry with the customer key already exists", :ordinal_id=>"0", :error_code=>"9999999", :object=>{:partner_key=>nil, :object_id=>"e6358dd9-b21e-4ee8-af1b-0d9217db755f", :customer_key=>"34847-test-query-restore", :"@xsi:type"=>"QueryDefinition"}}
Describe the bug
This gem does not work when git is not installed - this can be a problem in production servers, even if git based deployment is used. It is because it does this in the gemspec:
spec.files = `git ls-files`.split($/)
I fixed it like this:
spec.files = `du -a`.split("\n").map{|line| line.split("\t")[1].sub('./','')} - ["spec", "samples", ".github/ISSUE_TEMPLATE", ".github", "lib/marketingcloudsdk", "lib", "."]
Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (e.g. gif) is not sufficient.
Environment
The bug has the severity
Additional context
Add any other context about the problem here.
On the Account Information, for API Integration, there are 6 different pieces of information on the page:
From the readme this is what is available:
myclient = MarketingCloudSDK::Client.new(
'client' => {
'id' => 'exampleID',
'secret' => 'exampleSecret',
'base_api_url' => 'http://getapis',
'request_token_url' => 'http://authapi',
'soap_endpoint' => 'http://soapendpoint'})
I've tried mapping several variations, but it's not working for me. Is there a better example of the code above that would indicate what's best to use here?
Hi,
Since today, I am getting SSL error
when trying to access Marketing cloud APIs using FuelSDK-Ruby
. It keep on throwing the two errors
SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A
and Connection reset by peer - SSL_connect
.
I am using OpenSSL version: 1.0.2l (macOS Sierra version: 10.12)
Below is the trace of the error:
SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/httpi-2.0.2/lib/httpi/adapter/net_http.rb:36:in `rescue in request'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/httpi-2.0.2/lib/httpi/adapter/net_http.rb:27:in `request'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/httpi-2.0.2/lib/httpi.rb:137:in `request'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/httpi-2.0.2/lib/httpi.rb:103:in `get'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/wasabi-3.1.0/lib/wasabi/resolver.rb:42:in `load_from_remote'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/wasabi-3.1.0/lib/wasabi/resolver.rb:32:in `resolve'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/wasabi-3.1.0/lib/wasabi/document.rb:120:in `xml'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/wasabi-3.1.0/lib/wasabi/document.rb:138:in `parse'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/wasabi-3.1.0/lib/wasabi/document.rb:125:in `parser'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/wasabi-3.1.0/lib/wasabi/document.rb:61:in `soap_actions'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/savon-2.2.0/lib/savon/operation.rb:21:in `ensure_exists!'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/savon-2.2.0/lib/savon/operation.rb:14:in `create'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/savon-2.2.0/lib/savon/client.rb:32:in `operation'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/savon-2.2.0/lib/savon/client.rb:36:in `call'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/bundler/gems/FuelSDK-Ruby-384a48ab965a/lib/marketingcloudsdk/soap.rb:275:in `soap_request'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/bundler/gems/FuelSDK-Ruby-384a48ab965a/lib/marketingcloudsdk/soap.rb:219:in `soap_get'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/bundler/gems/FuelSDK-Ruby-384a48ab965a/lib/marketingcloudsdk/objects.rb:43:in `get'
Connection reset by peer - SSL_connect
/Users/jayaprakash/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:933:in `connect_nonblock'
/Users/jayaprakash/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:933:in `connect'
/Users/jayaprakash/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:863:in `do_start'
/Users/jayaprakash/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:852:in `start'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/httpi-2.0.2/lib/httpi/adapter/net_http.rb:54:in `do_request'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/httpi-2.0.2/lib/httpi/adapter/net_http.rb:31:in `request'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/httpi-2.0.2/lib/httpi.rb:137:in `request'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/httpi-2.0.2/lib/httpi.rb:103:in `get'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/wasabi-3.1.0/lib/wasabi/resolver.rb:42:in `load_from_remote'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/wasabi-3.1.0/lib/wasabi/resolver.rb:32:in `resolve'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/wasabi-3.1.0/lib/wasabi/document.rb:120:in `xml'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/wasabi-3.1.0/lib/wasabi/document.rb:138:in `parse'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/wasabi-3.1.0/lib/wasabi/document.rb:125:in `parser'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/wasabi-3.1.0/lib/wasabi/document.rb:61:in `soap_actions'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/savon-2.2.0/lib/savon/operation.rb:21:in `ensure_exists!'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/savon-2.2.0/lib/savon/operation.rb:14:in `create'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/savon-2.2.0/lib/savon/client.rb:32:in `operation'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/gems/savon-2.2.0/lib/savon/client.rb:36:in `call'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/bundler/gems/FuelSDK-Ruby-384a48ab965a/lib/marketingcloudsdk/soap.rb:275:in `soap_request'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/bundler/gems/FuelSDK-Ruby-384a48ab965a/lib/marketingcloudsdk/soap.rb:219:in `soap_get'
/Users/jayaprakash/.rvm/gems/ruby-2.3.1@mcapp/bundler/gems/FuelSDK-Ruby-384a48ab965a/lib/marketingcloudsdk/objects.rb:43:in `get'
Can anyone help me please.
Thank you.
5 months since last update, no responses to issues for the last 3 months. Is ET putting resources toward maintaining and developing these SDKs or should we move over to barberj's fork at https://github.com/barberj/fuelsdk ?
It looks like the class starting on line 163 of lib/new.rb
(ET_Client
) is dead code and is overridden by lib/marketingcloudsdk.rb
line 54. Would you please delete this and any other code that might be useless at this point? We just spent a couple of hours trying to debug code that isn't used anywhere.
Thanks!
Having switched to the Dot9Refactor branch, I'm still getting the error:
"Requested value 'APIObject' was not found."
This is the same error I got when trying to send a post request to a data extension using the master branch, and it is caused by the same test re-implemented using your Dot9Refactor branch.
Can you please do a proper test of the DataExtension post method against an actual live Exact Target account? Since the post test is the only one of my suite that's failing (all the rest are get) I'm still inclined to think that this is a bug with the FuelSDK-Ruby library. But I'd be happy to find out otherwise, that'd be easier to fix!
Triggered Sends are failing when I use the gem.
I have checked against another gem 'exact_target' and the credentials are valid as the calls go through but I actually get a describe error when trying to perform the same action using this gem.
[ Sensitive information such a keys and email addresses have been filtered out ]
auth = FuelSDK::Client.new({'client'=>{'id'=>'#{ENV['client_id']}','secret'=>'#{ENV['client_secret']}'}})
=> #<FuelSDK::Client:0x007fb58bbff4d0 @debug=false, @id="#{ENV['client_id']}", @secret="#{ENV['client_secret']}", @Signature=nil>
1.9.3p484 :035 > auth.debug = true
=> true
1.9.3p484 :036 > ts = FuelSDK::TriggeredSend.new
=> #FuelSDK::TriggeredSend:0x007fb58bc42708
1.9.3p484 :037 > ts.authStub = auth
=> #<FuelSDK::Client:0x007fb58bbff4d0 @debug=true, @id="#{ENV['client_id']}", @secret="#{ENV['client_secret']}", @Signature=nil>
1.9.3p484 :038 > ts.props = { "CustomerKey" => "Test" }
=> {"CustomerKey"=>"Test"}
1.9.3p484 :039 > ts.subscribers = [{"EmailAddress"=>"[email protected]","SubscriberKey"=>"[email protected]"}]
=> [{"EmailAddress"=>"[email protected]", "SubscriberKey"=>"[email protected]"}]
1.9.3p484 :040 > rs = ts.send
FuelSDK::DescribeError: Unable to get TriggeredSend
from ~/.rvm/gems/ruby-1.9.3-p484@journey-merchant-portal/gems/fuelsdk-0.1.6/lib/fuelsdk/soap.rb:163:in get_all_object_properties' from ~/.rvm/gems/ruby-1.9.3-p484@journey-merchant-portal/gems/fuelsdk-0.1.6/lib/fuelsdk/soap.rb:213:in
get_editable_properties'
from ~/.rvm/gems/ruby-1.9.3-p484@journey-merchant-portal/gems/fuelsdk-0.1.6/lib/fuelsdk/soap.rb:356:in format_object_cud_properties' from ~/.rvm/gems/ruby-1.9.3-p484@journey-merchant-portal/gems/fuelsdk-0.1.6/lib/fuelsdk/soap.rb:377:in
normalize_properties_for_cud'
from ~/.rvm/gems/ruby-1.9.3-p484@journey-merchant-portal/gems/fuelsdk-0.1.6/lib/fuelsdk/soap.rb:385:in soap_cud' from ~/.rvm/gems/ruby-1.9.3-p484@journey-merchant-portal/gems/fuelsdk-0.1.6/lib/fuelsdk/soap.rb:290:in
soap_post'
from ~/.rvm/gems/ruby-1.9.3-p484@journey-merchant-portal/gems/fuelsdk-0.1.6/lib/fuelsdk/objects.rb:139:in send' from (irb):40 from ~/.rvm/gems/ruby-1.9.3-p484@journey-merchant-portal/gems/railties-3.2.16/lib/rails/commands/console.rb:47:in
start'
from ~/.rvm/gems/ruby-1.9.3-p484@journey-merchant-portal/gems/railties-3.2.16/lib/rails/commands/console.rb:8:in start' from ~/.rvm/gems/ruby-1.9.3-p484@journey-merchant-portal/gems/railties-3.2.16/lib/rails/commands.rb:41:in
<top (required)>'
from script/rails:6:in require' from script/rails:6:in
Hi Team,
I have created one Email Data Extension object in Marketing Cloud which have below fields-
Object Name: books
bookid text . (Primary Key)
name text
description text
I am trying to post data from Ruby code with FuelSDK Gem but getting below error message evry time while post
Error Message : TypeError (no implicit conversion of String into Integer)
Please find the below line of code for the same-
dataextension = FuelSDK::DataExtension::Row.new
dataextension.authStub = myClient
dataextension.Name = 'books'
dataextension.CustomerKey='booksdetail'
dataextension.props = {'boodid' => 'S1234', 'name' => 'MyBookDetails', 'description' => 'Hello'}
results = dataextension.post
I am getting this error on dataextension.post. Please let me know what I doing mistake here.
I could just be missing them, but I don't see a FuelSDK::Query or equivalent. Is it possible to dynamically generate and run query activities?
Or is there another way of running SQL queries against a data extension via the API? My understanding is that the simple filter functionality in FuelSDK::DataExtension won't be able to return COUNT(), and since I'm trying to pull tracking data the number of raw rows will be in the millions (and thus be severely truncated by the API's 2500 row return limit).
My thought was to dynamically generate a temporary data extension and a temporary query which would populate the data extension with the count data I'm looking for. Then the data extension contents would be pulled down via API and the temporary data extension and query deleted.
Also, all the old docs are gone and don't have redirects?
Example: https://code.exacttarget.com/sdks/fuel-sdk-interacting-subscriber
Would you be open to running the codebase through rubocop and adding that to some kind of CI? This would make it easier for people to contribute by bringing the code basically in line with standard Ruby styles. The particular thing I'd like to see changes is going to 2 spaces for indentation instead of tabs.
Thanks!
I've got some code using this gem which starts an Import. I would like to change it to start a Program instead, but it looks like there's no support for running a Program in the gem. Are Programs supported, or is that in the works?
(Looking at the other classes, like Import - https://github.com/ExactTarget/FuelSDK-Ruby/blob/master/lib/fuelsdk/objects.rb#L216 - it seems as though adding support for Programs might be fairly simple, but I don't know whether the underlying SOAP API has the functionality that would be needed.)
Is there a way for a subscriber to be unsubscribed from a single list?
When trying to create a Data extension using the API, I encounter this error :
{:status_code=>"Error",
:status_message=>
"Error occurred while saving Custom Object DE example (xxxxxxx-xxxxxx-xxxx): Incorrect syntax
near ','.\nIncorrect syntax near the keyword 'with'. If this statement
is a common table expression, an xmlnamespaces clause or a change tracking context clause, the
previous statement must be terminated with a semicolon.\nIncorrect syntax near the keyword 'with'.
If this statement is a common table expression, an xmlnamespaces clause or a change tracking
context clause, the previous statement must be terminated with a semicolon.",
It is a SQL error on their server. Anyone else got this ?
Describe the bug
Savon 2.12.1
supports write_timeout
option in addition of open_timeout
and read_timeout
savonrb/savon#834.
When we fetch data extension rows with filter, we have write_timeout
error
HTTP::TimeoutError
Write timed out after 0.25 seconds
currently, this gem has defined options :
soap_client_options = {
soap_header: header,
wsdl: wsdl,
endpoint: endpoint,
wsse_auth: ["*", "*"],
raise_errors: false,
log: debug,
open_timeout:180,
read_timeout: 180,
headers: {'User-Agent' => 'FuelSDK-Ruby-v' + MarketingCloudSDK::VERSION}
}
To Reproduce
Steps to reproduce the behavior.
Expected behavior
A clear and concise description of what you expected to happen.
Code snippet
reader = MarketingCloudSDK::DataExtension::Row.new
reader.customer_key = data_extension_key
reader.props = Array(columns)
reader.filter = filter if filter
reader.authStub = auth_client
response = reader.get
Environment
1.3.1
2.5.1
The bug has the severity
Additional context
Add any other context about the problem here.
We are trying to bring up our MarketingCloud integration, and trying to decide whether to use this SDK, which seems to be abandoned. @amagar088, you did the last string of commits (ending in 2016) โ are you still around? What is the roadmap? Thanks.
In an enterprise installation, you have to provide a client ID as part of the SOAP response. I subclassed it to fix the issue in my system:
class OurWorkingTriggeredSend < MarketingCloudSDK::TriggeredSend
def send(client_id)
if properties.is_a? Array
tscall = []
properties.each do |p|
tscall.push(
'TriggeredSendDefinition' => {
'CustomerKey' => p['CustomerKey']
},
'Subscribers' => p['Subscribers'],
'Attributes' => p['Attributes'],
'Client' => { 'ID' => client_id }
)
end
else
tscall = { 'TriggeredSendDefinition' => properties, 'Subscribers' => @subscribers, 'Attributes' => @attributes, 'Client' => { 'ID' => client_id } }
end
client.soap_post 'TriggeredSend', tscall
end
end
But I'm not sure how this would prefer to be fixed upstream. If you would give me any hints as to a preferred mechanism, I'll send a pull request.
Thanks!
Is your feature request related to a problem? Please describe
The JSON library is too old. Need to use a new version with new gems.
Describe the solution you'd like
Update json library max requisites.
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
fuelsdk (>= 0) ruby depends on
activesupport (~> 3.2.8) ruby
We are diving into a substantial project with ET and Ruby. We've currently written our own wrapping layers around the Dot9Refactor branch. Kudos to Barberj for getting started on the work of making this interface a little more Rubyish.
If we find bugs, is the best place to report them here? Report them to premium ET support? Given how far the Ruby driver has to come, we're happy to contribute back what we discover in our travels, but want to make sure we're helping, not creating noise.
In particular, we'd love to work off of this repo, instead of branching our own...
When calling CreateAndStartDataExtensionImport
and passing it the customer key for my data extension, it fails because it's setting DestinationObject
using ObjectID
instead of CustomerKey
.
Fix is as simple as changing it to use CustomerKey
instead. Pull request to come.
Am I missing something? Created an App for s1.q1 in Appcenter and tried sample executing code in irb
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
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'
Is your feature request related to a problem? Please describe
As of September 30, 2022, SFMC will require "tenant-specific endpoints" instead of the ones currently used by this gem. The following page explains the changes:
https://help.salesforce.com/s/articleView?id=000357115&type=1
Describe the solution you'd like
In my opinion, the Client method will need to be modified to either accept a tenant-specific endpoint parameter during initialization, or obtain this via the API if that's possible.
If an API request results in greater than 2500 results, the docs instruct users to call response.continue
to fetch the rest of the results, but doing so fails and instead results in an array being returned.
Created a pull request here: #84
*EDIT
Found an earlier PR here
#39
But as a temporary workaround, you can do the following:
response = @dataextensionrow.get
while response.more?
response.send(:unpack, @client.soap_client.call(:retrieve, message: { 'RetrieveRequest' => {'ContinueRequest' => response.request_id}}))
end
The getter defined for FuelSDK::Objects::Base#properties
returns an Array which causes code like:
# lib/fuelsdk/client.rb: 107
s = FuelSDK::Subscriber.new
s.properties = {"EmailAddress" => email, "Lists" => lists}
#[...]
s.properties['SubscriberKey'] = subscriber_key if subscriber_key
to fail with:
TypeError: can't convert String into Integer
from FuelSDK-Ruby/lib/fuelsdk/client.rb:113:in `[]='
from FuelSDK-Ruby/lib/fuelsdk/client.rb:113:in `AddSubscriberToList'
You can work around this with:
s.properties.first['SubscriberKey'] = subscriber_key if subscriber_key
However, this approach of setting properties to a hash and then adding additional properties is used through out the code, so the simple fix it probably the wrong one.
When patching an existing Subscriber to change their status from 'Unsubscribed' to 'Active' on a specific list, the wrong list gets activated.
So e.g. if Subscriber is 'Unsubscribed' on both List1 and List2, and you patch the Subscriber to activate them on list2. List1 gets activated and List2 remains 'Unsubscribed'
sub = FuelSDK::Subscriber
sub.authStub = authStub
sub.props = {'Status' => 'Active', 'SubscriberKey' => email_address, 'ID' => subscriber_id, 'ListID' => list_id}
sub.patch
Patch succeeds but a query of the FuelSDK::List::Subscriber for that email address shows that the wrong list_id was updated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.