I’m using Node js, and I can create/update a contact’s email, name, or phone number. But the custom fields I have never get updated. Here’s what I got so far.
var data = JSON.stringify({
"contact": {
"email": "t@brady.com",
"firstName": "Tom",
"lastName": "Brady",
"phone": "111122233",
"myCustomField": "myValue"
}
});
var options = {
hostname: hostname,
path: '/api/3/contact/sync',
method: 'POST',
headers: {
'Api-Token': apiToken,
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': data.length
}
}
var req = this.https.request(options, function(res){
});
req.on('error', function(err){
console.log('error: ' + err.message);
});
req.write(data);
req.end();
So this will update the contact's built-in fields (email, name, phone) but not myCustomField. Any idea why? How to solve it? I would really appreciate any help.
P.S. myCustomField exists in Active Campaign. The contact just doesn't have a value for it.