【问题标题】:Is there a way to fix this Mailchimp API error in node?有没有办法修复节点中的这个 Mailchimp API 错误?
【发布时间】:2021-04-24 22:30:10
【问题描述】:

有没有办法修复 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.'
    }
  ]
}

【问题讨论】:

    标签: node.js mailchimp


    【解决方案1】:

    Node 应用尝试执行的 API 调用是什么?看起来它正在尝试将成员添加到列表中,因此假设您正在发出此请求 POST /lists/{list_id}/members

    正文中的必填字段需要是:

    {
        "email_address": "",
        "status": ""
    }
    

    根据错误消息,您没有在 POST 请求中传递状态。可能的值如下:“subscribed”、“unsubscribed”、“cleaned”、“pending”或“transactional”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-14
      • 1970-01-01
      • 2021-01-25
      • 1970-01-01
      • 1970-01-01
      • 2023-04-07
      • 1970-01-01
      • 2022-08-04
      相关资源
      最近更新 更多