James Chevalier
James Chevalier

Reputation: 10874

What causes -32601 errors when using the MailChimp API?

I'm using the hominid gem to interface with the MailChimp API, and my attempts at updating the content of a campaign are failing.

The code I'm using to update the campaign is:

h = Hominid::Base.new({:api_key => ENV["MAILCHIMP_API_KEY"]})
h.update(self.mail_chimp_campaign_id, "content", {:html_content => content_string})

The error that I'm getting is:

<-32601> server error. requested method not found

What's causing this?

Upvotes: 3

Views: 287

Answers (1)

James Chevalier
James Chevalier

Reputation: 10874

I found out that the problem was with the content I was trying to send to MailChimp. There were some special characters that MailChimp couldn't handle, and things worked fine after cleaning up the data I was attempting to send off.

While it didn't help me in my situation, I did read here that converting the data before sending it off to MailChimp is a possible resolution. The suggestion is to take the data that's causing the issue, and run it through Iconv before sending it off to MailChimp:

utf8_to_ascii = Iconv.new("US-ASCII//TRANSLIT//IGNORE", "UTF8")
utf8_to_ascii.iconv(gnarly_user_data)

Upvotes: 3

Related Questions