Mailchimp API合并字段-日期格式

问题描述 投票:0回答:1

我正在使用Mailchimp API添加新成员。

我已经定义了一个名为ADDED的自定义合并字段,这是我将该成员添加到列表中的日期。我希望通过API提交时需要此字段。我将其定义为DD/MM/YYYY格式(见下文):

enter image description here

这是我的json字符串的样子:

{
    "email_address":"[email protected]", 
    "status":"subscribed", 
    "merge_fields": 
         {"USERLEVEL":"1", "BATCH":"999000", "ADDED":"21/04/2020"}
}

如您所见,我的格式确实是`dd / mm / yyyy',但是在提交API请求时,我收到此错误消息:

**Your merge fields were invalid: Please enter the date**

{"type":"http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/",
"title":"Invalid Resource","status":400,
"detail":"Your merge fields were invalid.",
"instance":"1ad6bc0e-7728-45c1-a308-b751247efb5b",
"errors":[{"field":"ADDED","message":"Please enter the date"}]}

有人在请求中的日期格式似乎正确时,谁能解释我为什么会收到此错误?

谢谢。

mailchimp-api-v3.0
1个回答
0
投票

[确定,似乎将字段定义为DD/MM/YYYY可能仅用于读取目的。但是对于提交,必须这样完成:

"ADDED":"2020-04-21T00:00:00.001Z"

© www.soinside.com 2019 - 2024. All rights reserved.