有没有办法修复 Node.js 中的 MailChimp API 错误?
{
type: 'http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/',
title: 'Invalid Resource',
status: 400,
detail: "The resource submitted could not be validated. For field-specific details, see the 'errors' array.",
instance: '95a2824e-4f30-4ce4-8c5e-322859d933e4',
errors: [
{
field: 'members.item:0.status',
message: 'Data presented is not one of the accepted values: subscribed, unsubscribed, cleaned, pending.'
}
]
}
答案 0 :(得分:0)
Node 应用程序尝试执行的 API 调用是什么?看起来它试图将成员添加到列表中,因此假设您正在发出此请求 POST /lists/{list_id}/members
正文中的必填字段需要是:
{
"email_address": "",
"status": ""
}
根据错误消息,您没有在 POST 请求中传递状态。可能的值如下:“subscribed”、“unsubscribed”、“cleaned”、“pending”或“transactional”。