activecampaign-api-php icon indicating copy to clipboard operation
activecampaign-api-php copied to clipboard

Date custom field

Open ValerioRossi86 opened this issue 6 years ago • 13 comments

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 script I wrote in php, but I get a 500 errors when I test it: <?php

require_once("includes/ActiveCampaign.class.php");
$ac = new ActiveCampaign("MY_URL", "MY_API_KEY");

$email = $contact['email'];

/*
* ADD OR EDIT CONTACT (TO THE NEW LIST CREATED ABOVE).
*/
//$data = date("Y-m-d h:i:s");
$data = date("d-m-Y");
$contact = array(
  "email"              => $email,
  "first_name"         => "Test",
  "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. Does the API support date updates?

Thanks

ValerioRossi86 avatar Nov 22 '18 14:11 ValerioRossi86

Hi, I'm Tim, the integrations product manager at ActiveCampaign. What's a good email address to follow up with you on this issue?

ac-tjahn avatar Nov 26 '18 16:11 ac-tjahn

This one is ok, thanks. Valerio

On 26. Nov 2018, at 17:29, Tim Jahn <[email protected] mailto:[email protected]> wrote:

What's a good email address to follow up with you on this issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ActiveCampaign/activecampaign-api-php/issues/103#issuecomment-441703870, or mute the thread https://github.com/notifications/unsubscribe-auth/AWTC6R2s_-jyxAhqotrT5GV2q6V0R1lQks5uzBbNgaJpZM4Yve9E.

-- Valerio Rossi www.universita.it Roma, Kognoscenti S.r.l.

ValerioRossi86 avatar Nov 26 '18 17:11 ValerioRossi86

Unfortunately, it looks like I'm unable to see your email address. If you don't want to post it publicly here, feel free to shoot me an email - tjahn at activecampaign. Thanks!

ac-tjahn avatar Nov 26 '18 17:11 ac-tjahn

[email protected]

On 26. Nov 2018, at 18:56, Tim Jahn <[email protected] mailto:[email protected]> wrote:

Unfortunately, it looks like I'm unable to see your email address. If you don't want to post it publicly here, feel free to shoot me an email - tjahn at activecampaign. Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ActiveCampaign/activecampaign-api-php/issues/103#issuecomment-441735122, or mute the thread https://github.com/notifications/unsubscribe-auth/AWTC6VKPUweGAQn_U7Sr8WvHlgdNA6mIks5uzCtegaJpZM4Yve9E.

-- Valerio Rossi www.universita.it Roma, Kognoscenti S.r.l.

ValerioRossi86 avatar Nov 26 '18 18:11 ValerioRossi86

Was this ever solved? I have a custom field which is a date field, and I can not update it utilizing contact/sync. I have tried several formats for the date but nothing works. What is the correct format to submit/update a date field?

mattpramschufer avatar May 02 '19 16:05 mattpramschufer

Yes, it is solved.

On 2. May 2019, at 18:30, Matt Pramschufer [email protected] wrote:

Was this ever solved? I have a custom field which is a date field, and I can not update it utilizing contact/sync. I have tried several formats for the date but nothing works. What is the correct format to submit/update a date field?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ActiveCampaign/activecampaign-api-php/issues/103#issuecomment-488741215, or mute the thread https://github.com/notifications/unsubscribe-auth/AFSMF2OJTFQHKYVHGZGED3TPTMJLDANCNFSM4GF555CA.

ValerioRossi86 avatar May 03 '19 16:05 ValerioRossi86

disappointed to see that this issue seems to have been resolved outside of Git, which makes it inaccessible to anyone else who is having a similar issue. :/

DonnieM77 avatar Apr 16 '20 17:04 DonnieM77

Can someone share the solution?

dautry avatar Oct 21 '20 18:10 dautry

I'm having same issue while trying to update a contacts' custom datetime fields. i've tried a million different date formats, but nothing seems to update the field.

PPWSK avatar Jul 25 '21 11:07 PPWSK

@PPWSK & @dautry a datetime field should be in iso8601 format. So for example: "2021-08-24T09:45:00+02:00"

A date field should be formatted as 2021-08-23

reinaris avatar Aug 23 '21 13:08 reinaris

@reinaris What is the expected timezone for the custom datetime fields? I could not find any documentation in AC API that speaks about the default timezone that is used for the values passed.

ravick12 avatar Nov 16 '21 21:11 ravick12

@reinaris What is the expected timezone for the custom datetime fields? I could not find any documentation in AC API that speaks about the default timezone that is used for the values passed.

Good question, I have no clue! I think you have to find out by trying :)

reinaris avatar Nov 16 '21 21:11 reinaris