How to update FieldValues for Contacts

Hi,

I m trying to create or update custom field values using the v3 API.

  1. find out if a custom fieldvalue exsists,
  2. if it does update it
  3. if it does not, create it.

The problem is in the first step:

There is no GET /fieldValues documented, however, this endpoint does exist and returns all field values, but filter[contact] or filter[field] are not supported it seems. The only way would be to get all filedvalues for all fields and contacts and then filtering them in my client, but for 40K records, this is very inefficient.

Another option would be to do a POST and then a PUT if it returns an error. I can create a fieldValue using POST /fieldValues, but if I POST the fieldValue again, the post gets accepted (with a new id) and does not return an error. Furtermore, the value does not change in the UI.

Is there another way to do this, or can the Get /FieldValues be extended with filters on contact and field. An alternative would be to return an error if the contact/field combination alreay exists on POST.

1 Like

I’ve submitted your info to our technical support team, who will be in touch soon. Thanks!

Was there a solution to this problem - please can you share?

There is now a GET /fieldValues call available here: https://developers.activecampaign.com/v3/reference#list-all-custom-field-values-1

Hope this helps!

hi is there an API to update custom fields of contact?

If you want to update only the custom field use the API v3
https://developers.activecampaign.com/reference#update-a-custom-field-value-for-contact

If you want to update the contact and his custum fields in one call use the API v1
https://www.activecampaign.com/api/example.php?call=contact_sync

1 Like

thank you I made it with v1 api