I'm using the FuelSDK, ruby version. The retrieve rows function worked fine for me, but the function to remove a row from a data extension gives me an error.
This is what I'm doing:
client = ET_Client.new auth
de_row = ET_DataExtension::Row.new()
de_row.authStub = client
de_row.CustomerKey = "XXXXXXXXXXXXXXXX"
de_row.props = {"Web_FIC" => fic}
response = de_row.delete
And this is the error that I receive:
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
'
from script/rails:6:in require'
from script/rails:6:in
'
I'm using ruby 1.9.3. Any idea why I'm having this problem?
UPDATE
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?
UPDATE 2
I solved the problem.
Comparing the request generated on the PHP version with the one of the ruby version I noticed that the PHP version had the following tags:
PHP Version
-----------
<ns1:Keys>
<ns1:Key>
<ns1:Name>Web_FIC</ns1:Name>
<ns1:Value>XXXXXXXX</ns1:Value>
</ns1:Key>
</ns1:Keys>
While the ruby version was using Properties instead of Keys and Property instead of Key:
Ruby Version
-----------
<tns:Properties>
<tns:Property>
<tns:Name>Web_FIC</tns:Name>
<tns:Value>XXXXXXXX</tns:Value>
</tns:Property>
</tns:Properties>
I changed the fuelsdk gem to use Keys and Key and it worked. I'm not sure if there is a way to set the keys without needing to change the gem, but anyway the documentation doesn't specify that.
If somebody knows a better way to set the keys (instead of properties) please let me know.
Thanks