ActiveCampaign Forum

API V3 - How to set contact custom fields on add/sync api calls


#1

Hello!

I am reading the api V3 documentation but I could not find how to update/add custom fields in contacts add/sync function.

I read the api v1 and it’s possible to add custom fields:

My contacts have a lot of custom fields which I intend to use later to create automatons, etc.

Anyone know how can I set multiple custom fields while adding/sync contacts?

e.g

contact : { firstName: 'Joe', lastName: 'Smith', email: 'joe@joe.com', /*custom fields*/ myCustomFieldA: 'aaa', myCustomFieldB: 'bbbb }

Thanks!


#2

+1 on this one. We are trying to achieve the same thing.

We have coded a custom deep data integration. & now need to also update some custom fields every time an order goes through. Thinking using the add/sync contact update is the best idea, but lots how to update 10 fields at once.

Any help would be appreciated.


#3

Hello @henryreith.

I’ve found this API call to update fields:

But it does not tell how we can update multiple custom fields at once and also it does not allow us to add/sync contacts and set the custom fields at the same time. According to documentation, we would have to do 2 Http calls to simply add a contact and set custom fields:

1- http call to sync the contact
2- http call to update custom fields (I don’t even know if this is possible as the documentation shows only one custom field at request body. I’ll try it out passing multiple fields in request body to see how api will respond.

Even if this option works, would be necessary to do 2 http calls. Would be easier if add-sync contact Api call also supports custom fields, as they are directly related to contacts.

Note: It sounds possible on API version 1. https://www.activecampaign.com/api/example.php?call=contact_add. I will keep you update if I find a good solution for that.

Cheers


#4

Nice work. That’s what we have found too. So we are using the API V1 to update contacts custom fields as we have so many to do at once.


#5

Awesome! Doing same here as we also have many custom fields :slight_smile: