Mailchimp API 2.0列出/订阅响应错误250 List_MergeFieldRequired MMERGE4是必需的

时间:2015-04-22 17:44:24

标签: mailchimp

我尝试使用lists/subscribe Mailchimp API 2.0端点订阅电子邮件到列表,但我一直遇到一个令人费解的错误。我的请求如下:

{
    "apikey":"myapikey-us5",
    "id":"listid",
    "email":{"email":"my@email.com"},
    "double_optin":false,
    "send_welcome":true
}

我发送给https://us5.api.mailchimp.com/2.0/lists/subscribe.json并收到此回复:

{
    "status": "error",
    "code": 250,
    "name": "List_MergeFieldRequired",
    "error": "MMERGE4 must be provided - Please enter a value"
}

如果我指定"merge_vars": {},我仍会得到同样的错误。我在这里错过了什么?

1 个答案:

答案 0 :(得分:2)

这意味着您需要为MMERGE4合并字段提供值。你如何做到这一点取决于MMERGE4是什么类型的合并字段,但它会是这样的:

{
    "apikey":"myapikey-us5",
    "id":"listid",
    "email":{"email":"my@email.com"},
    "double_optin":false,
    "send_welcome":true,
    "merge_vars": {
        "MMERGE4": "something"
    }
}

但您应该查看并查看哪种类型的数据,否则您可能会因为将其设置为必填字段而导致问题。