ActiveCampaign Forum

'Contact Email Address is not valid' on API v1



I’ve been trying to add some contacts via API v1 and I managed to make work with POSTman.

When I try to use a nodeJS application for the calls, the API keeps replying as a “Contact Email Address is not valid”.

I followed the API docs and added all the required fields. Is there something I’m missing from the call?

I know there is v3 of API, but can’t add custom fields using api/3/contact/sync (ie: Arrival, Departure, segment… )

var options = { 
        method: 'POST',
        url: '',
          'Content-Type': 'application/x-www-form-urlencoded' 
            api_key: 'ourAPI',
            api_action: 'contact_add',
            api_output: 'json',
            'p[4]': '4',
            "field[%FIRSTNAME%,0]"    : row[2],
            "field[%LASTNAME%,0]"     : row[0],
            "field[%EMAIL%,0]"        : row[3],
            "field[%PHONE%,0]"        : row[4],
            "field[%PROPERTY%,0]"     : row[5],
            "field[%ARRIVAL%,0]"      : row[6],
            "field[%DEPARTURE%,0]"    : row[7],
            "field[%SEGMENT%,0]"      : row[8],
            "field[%SEX%,0]"          : row[9],
            "field[%NATIONALITY%,0]"  : row[10],

Any person find themselves in this situation? Any ideas of what I could try next?