Mailchimp 标记 API 静默失败 [英] Mailchimp tag API silently failing

查看:40
本文介绍了Mailchimp 标记 API 静默失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我像这样调用 Node.js Mailchimp API:

I'm calling the Node.js Mailchimp API like so:

const mailchimp = require('@mailchimp/mailchimp_marketing');
const md5 = require('md5');

// ...

const resp = await mailchimp.lists.updateListMemberTags(
  mailchimpListId,
  md5('my@email.com'),
  { tags: [{ name: 'Tag Name', status: 'active' }] }
);

(resp === null) // true

  • 订阅者存在
  • md5 库正在提供有效的 md5 哈希(通过成功调用 getListMemberTags 确认)
  • 没有产生错误
  • 但是响应为空,并且标签没有被添加到订阅者.

    But the response is null, and the tag is not being added to the subscriber.

    关于为什么它可能会默默失败的任何想法,如果是,我该如何调试它?

    Any ideas as to why it might be silently failing, and if so, how I can debug it?

    (如果相关,这一切都在 Auth0 自定义操作中运行.)

    (If relevant, this is all being run within an Auth0 Custom Action.)

    推荐答案

    感谢 Mailchimp 的 Buck,我找到了解决方案.与库中的大多数 API 调用不同,updateListMemberTags 需要像这样的主体包装器:

    Thanks to Buck at Mailchimp, I found the solution. Unlike most API calls in the library, updateListMemberTags needs a body wrapper like so:

    const resp = await mailchimp.lists.updateListMemberTags(
      mailchimpListId,
      md5('my@email.com'),
      { body: { tags: [{ name: 'Tag Name', status: 'active' }] } }
    );
    

    这篇关于Mailchimp 标记 API 静默失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆