Using the Constant Contact Ruby gem to add a contact


Using the Constant Contact Ruby gem to add a contact



I'm attempting to use the Constant Contact gem (here ) to add a contact. However, I can't find anything that tells me how to go about doing this. I've tried looking through the gem itself, and attempting various methods to no avail. I have the gem setup in my app, I have an API key, and I can successfully get a list of contacts, but that functionality is completely useless to me. When I try to use the same object with the add_contact method (i.e. cc.add_contact(token, @contact, true)), I get a 400 Bad Request error. Is there anything posted anywhere that details simply how to add a contact? Such information would be greatly appreciated!






Thanks for posting.  Have you had a look at the example?  Inside the SDK is a small ruby app that makes a PUT or POST of a contact to a selected list.  It's located here:


The methods I'm referring to are in myapp.rb on lines 145 and 147.  I'm not sure if the gem had a method with three arguments for the add, the one in the example has only two.  I hope this helps.




Andrew B.

Constant Contact

API Support

Hi Andrew,


Thanks for the reply. I've been trying to use the same method as the one in the code posted. When I was looking at the code in the gem, the third parameter in the method is optional. It's for initiated by user, but in any case, I get the same result with and without the third parameter. This is what I'm trying:



Developer Portal

View API documentation, code samples, get your API key.

Visit Page