ActiveCampaign Forum

Date custom fields through API


Hi there,
I have a date custom field that I would like to update through the API (I am using ActiveCampaign.class.php).

This is the webhook I wrote in php, but I get a 500 errors when I test it and the date field doesn’t get updated:

$ac = new ActiveCampaign("MY_URL", "MY_API_KEY");

$email = $contact['email'];

$data = date("d-m-Y");
$contact = array(
"email" = $email,
"field[%TEST_%,0]" = "OK",
"field[%DATE_TEST%,0]" = $data
$contact_sync = $ac->api("contact/sync", $contact);

Of course MY_URL and MY_API are filled with the correct data.

The webhook works as expected for the other custom fields but not for the date field.

Any ideas?


I’ve passed this on to our API support team and you should be hearing from them soon via email. Thanks!


Thanks a lot for your answer


Facing the same problem. What was the solution?
Guides also say “the date field has a time stamping option”. Does it mean that there is a possibility to set the date field with default current timestamp value? How can it be done?