Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lib/active_campaign/api/contacts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,25 @@ def delete_contact(id)
def update_contact(id, params)
put("contacts/#{id}", contact: params)
end

#
# Update list status for a contact
#
# @param [Hash] params to manage list status for a user
# @option params [Integer] :list - ID of the list to subscribe the contact to
# @option params [Integer] :contact - ID of the contact to subscribe to the list
# @option params [Integer] :status Set to "1" to subscribe the contact to the list. Set to "2" to unsubscribe the contact from the list.
#
# @return [Hash] a hash with information about the newly created contact
#

"list": 2,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look like proper ruby syntax to me?

"contact": 1,
"status": 1

def update_contact_list(params)
post("contactList", contact: params)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://developers.activecampaign.com/reference#update-list-status-for-contact it should be contact_list: params not contact: params

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • the url is invalid, should be 'contactLists'

end
end
end
end