API v3: Updating custom field of type checkbox for contact

Hi everybody,
I’m new to Active Campaign and try to setup API v3 calls from my website to AC to create and update contacts. I succeeded in creating and updating contacts and some custom fields but I can’t figure out how to update custom fields that are of the checkbox or select type. It seems that I need the FieldOption id, but how does the structure of the JSON look like to achieve this? I can’t find this case in the documentation.

Thanks for your help.

Hello @kuverum,

To update a custom field value that is a checkbox you’ll want to use the api/3/fieldValues/id endpoint.

This is a bit difficult to find in the documentation, so I’ll include a screenshot showing you how to find it since there is no way to link directly there. First, here are two examples of updating custom field values that are checkbox type. The first example would be for multiple selections, and the second for a single selection:

{
    "fieldValue": {
        "contact": 2,
        "field": 6,
        "value": "||Option 1||Option 3||Option 4||"
    }
}

{
    "fieldValue": {
        "contact": 2,
        "field": 6,
        "value": "||Option 2||"
    }
}

Here is a screenshot showing where to find this in the documentation:

I hope this helps! Please let us know if you have any further questions about this.

Thank you,
-Matt

2 Likes

Dear Matt, works perfectly, thanks for your help.

1 Like