nateleavitt / infusionsoft

Ruby Gem for the Infusionsoft API
MIT License
58 stars 63 forks source link

Where do I place API Call #18

Closed stanrails closed 11 years ago

stanrails commented 11 years ago

I'm new to rails so your patience with my rookie question is appreciated!

I've installed the gem successfully. I created the infusionsoft configuration file.

But... where do I put this api call?

Infusionsoft.contact_add({:FirstName => 'first_name', :LastName => 'last_name', :Email => 'test@test.com'})

Also does 'first_name', 'name' refer to database field names within infusionsoft? Also do I replace 'test@test.com' with the infusionsoft email field name?

Thanks for your help!

nateleavitt commented 11 years ago

Hello @stanrails

Sorry it's taken a couple weeks to respond. I was actually out of town a couple weeks ago, and am also on leave from work this week :)

Anyway, you can place the call wherever you would like. Just for testing I would place it in the controller, then once working you could move it to the model. Just depends on your strategy :)

Yes, the 'first_name' refers to attribute names on the model. So for example on your User model it could have an attribute named 'first_name', which in the Rails world, means you have a column named first_name on the users table :)

Let me know if you have any other questions.

-Nate

nateleavitt commented 11 years ago

Hi @stanrails

Wondering if you were able to get this working. Let me know.

stanrails commented 11 years ago

Yes I was able to get it working. Thank you for following up with me.

My next step is to use information provided in another controller/model to update the initial user's information. Basically, the person signs-up and gets added to my IS account. They then complete a scorecard. This scorecard is a different model with a different controller. I would like the scorecard controller to grab the id from the initial IS API call and use that to update custom fields in the user's record.

Any advice would be appreciated!

On Tue, Sep 3, 2013 at 11:29 AM, Nathan Leavitt notifications@github.comwrote:

Hi @stanrails https://github.com/stanrails

Wondering if you were able to get this working. Let me know.

— Reply to this email directly or view it on GitHubhttps://github.com/nateleavitt/infusionsoft/issues/18#issuecomment-23721369 .