ActiveCampaign Forum

Date custom fields through API


#1

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:

require_once("includes/ActiveCampaign.class.php");
$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?
Thanks


#2

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


#3

Thanks a lot for your answer


#4

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?