简体   繁体   中英

Add contact to Infusionsoft API with tags field

I am using Ruby on Rails framework. I want to add tag along with contact but its giving me error of "[NoFieldFound]No field found: Contact.Tags2". I am using following code:

    Infusionsoft.contact_add({:FirstName => 'Amy', :LastName => 'Smith', :Email => 'amysmith@gmail.com', :Tags2 => 244})

Can anyone please help me? How can we add tags along with contacts?

Preet, to add tags to a contact in Infusionsoft, you first need to add the contact, and then add the contact to a group (ie apply a tag)

In Ruby, you'd run:

Infusionsoft.contact_add_to_group(contact_id, group_id)

contact_id is the ID of the contact you created. group_id is the ID of the tag you want to apply, 244 in your example.

So to add a contact and then apply a tag, you'd run something like this:

contact_id = Infusionsoft.contact_add({:FirstName => 'Amy', :LastName => 'Smith', :Email => 'amysmith@gmail.com'})
Infusionsoft.contact_add_to_group(contact_id, 244)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM