4

I want to use the MailChimp API 3.0:

http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#

How do I set the query string parameter for the fields since_timestamp_opt, before_timestamp_opt, since_last_changed and before_last_changed?

Is it a timestamp, something like this: 2016-03-08 17:50:41 or something else?

Can somebody give me an example?

ekad
  • 14,436
  • 26
  • 44
  • 46
TomGrill Games
  • 1,553
  • 2
  • 16
  • 25

2 Answers2

5

It is 2016-03-08 17:50:41 YYYY-MM-DD hh:mm:ss

TomGrill Games
  • 1,553
  • 2
  • 16
  • 25
  • It's probably best to use ISO 8601 date format: 2004-02-12T15:19:21+00:00 -- that's what the API seems to produce, so the format you're listing might be working only by chance. – TooMuchPete Mar 10 '16 at 23:20
  • 2
    That does not work. Mailchimp (V3.0 interface) generates correct ISO8601 dates, but on input it REQUIRES that the "T" be a space and the +nn:nn time zone MUST NOT be present. – Ian Oct 19 '18 at 13:35
  • Thank you kind internet folk!! ISO 8601 specifies a "T" for date/time separation. Different separators are by "mutual agreement." There is no mention of this in the documentation, so they need to fix them. Spent too long being frustrated and waiting for their twitter response, so I hope someone finds this thread. – sean.hudson Jan 11 '19 at 23:12
  • Did this actually work for you? I've tried `since_timestamp_opt=2020-01-20%2000%3A00%3A00` and `since_timestamp_opt=2020-01-20T00%3A00%3A00%2B00%3A00` and not had any luck with either. It's behaving as though the parameter isn't there. I think they might have just broken these? – Kaoru Jan 27 '20 at 17:57
0

It does need to be ISO8601 format, but even though their API shows the Timezone offset, it has no effect on the date, and the string you pass must be in UTC. You can confirm this here: https://syncwith.com/api/mailchimp/get/3-0-lists-list-id-members

The dates are stored by Mailchimp in UTC. Calling them in the current timezone with the offset won't correct for the time difference--you'll have to convert to UTC first.

Ryan Buckley
  • 67
  • 1
  • 9