ActiveCampaign / activecampaign-api-php

MIT License
115 stars 76 forks source link

Date custom field #103

Open ValerioRossi86 opened 5 years ago

ValerioRossi86 commented 5 years ago

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

ac-tjahn commented 5 years ago

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

ValerioRossi86 commented 5 years ago

This one is ok, thanks. Valerio

On 26. Nov 2018, at 17:29, Tim Jahn <notifications@github.com mailto:notifications@github.com> 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.

ac-tjahn commented 5 years ago

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!

ValerioRossi86 commented 5 years ago

v.rossi@universita.it

On 26. Nov 2018, at 18:56, Tim Jahn <notifications@github.com mailto:notifications@github.com> 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.

mattpramschufer commented 5 years ago

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?

ValerioRossi86 commented 5 years ago

Yes, it is solved.

On 2. May 2019, at 18:30, Matt Pramschufer notifications@github.com 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.

DonnieM77 commented 4 years ago

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. :/

dautry commented 3 years ago

Can someone share the solution?

PPWSK commented 3 years ago

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.

reinaris commented 3 years ago

@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

ravick12 commented 2 years ago

@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.

reinaris commented 2 years ago

@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 :)