Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a contact to a list in ActiveCampaign API v3

According to v3 docs I should be able to add a contact to a list using the Contact API but I am at a loss on how to do so as I see nothing list related under Contacts.

How do I add a contact to a list (not through automations) using version 3 of the API? Or are the docs in error?

like image 585
cyberwombat Avatar asked Oct 09 '18 02:10

cyberwombat


2 Answers

The v3 docs have been updated (Lists documentation) and they no longer read that you can add a contact to a list through the API. ActiveCampaign Lists documentation screenshot

EDIT: you can add a contact to a list using the v1 contact_sync (contact_sync documentation)

SECOND EDIT: you can now add a contact to a list and/or change their subscription status to a given list through the v3 API! (update list status for a contact documentation)

like image 132
jhsiaomei Avatar answered Oct 09 '22 21:10

jhsiaomei


The above is no longer true. You can add a contact using the Create Contact endpoint.

It's basically a POST request that uses the following parameters:

  • E-Mail (Required)
  • First Name (Optional)
  • Last Name (Optional)
  • Phone (Optional)

The API v3 changed a lot though and now after you create a contact to do the following this you have to consult other endpoints. For example:

To add a contact to a list you need a POST request to the Contact Lists endpoint where you need to provide three parameters (listid, contactid, status).

If you need to assign a tag to a contact, in order to be able to create the relationship you first need to create the tag using the Create a new tag endpoint. And the use the resulting tag id with the Create Contact Tag endpoint where you combine said tag id with the contact id.

Now in order to remove that same tag the guys from Active Campaign made us work more and in order to remove a tag from a contact you don't use the contact's id and the tag's id, but rather you have to use the contact's id and the relationship id between the tag and the specific contact, that's quite a lot of steps, but I guess they wanted to make it very robuts in terms of structure.

There are many new endpoints which were actually available from around the date when you asked your question. You should check out the new API reference. It has some flaws and is not 100% complete yet, but it would be useful.

like image 7
Mihail Minkov Avatar answered Oct 09 '22 19:10

Mihail Minkov