【问题标题】:SendInBlue trackEvent returns 204 but does not show event in the consoleSendInBlue trackEvent 返回 204 但不在控制台中显示事件
【发布时间】:2021-07-05 11:03:45
【问题描述】:

我正在尝试使用 SendInBlue API here 发送事件。

当我发送事件时,它会正确返回 204 - 但我没有收到任何事件 here 并且我创建了一个由事件触发的自动化流程,但它不会发送。

const axios = require("axios");
const url = 'https://in-automate.sendinblue.com/api/v2/trackEvent';

(async() => {
    try {
       const event =  await axios.post(
            url,
            JSON.stringify(            {
                email: 'myemail@emailprovider.co',
                event: 'USER_SUBSCRIBED'
              }),
              {
                Accept: 'application/json',
                'Content-Type': 'application/json',
                'ma-key': 'xkeysib-MY_v3_API_KEY'
              },
        );
            
    console.log(event);
    } catch (err) {
        console.log(JSON.stringify(err))
    }
})();

有什么方法可以让我在控制台上看到来自此调用的事件?

【问题讨论】:

    标签: sendinblue


    【解决方案1】:

    ma-key 与 API KEY 不同。您应该使用 ma-key 而不是您当前的 API 作为自动化密钥。 经过几封邮件和一个电话后,我弄清楚了 ma-key 在哪里:

    您应该在 send inblue 处登录。单击自动化(顶部菜单)。单击配置(左侧选项卡栏)。单击“查看跟踪代码”之类的内容。然后,您会看到一个 JS 代码。在这段代码中,有一个键。这是你的钥匙。

    我的面板是西班牙语的,所以单词可能不一样。干杯。

    【讨论】:

    • 这怎么可能是安全的?您基本上从客户端代码 sn-p 中提取密钥,并使用它在服务器端验证自己?是什么阻止我获取某人的客户端密钥并触发一堆虚假事件?
    猜你喜欢
    • 2020-03-11
    • 1970-01-01
    • 2022-07-21
    • 1970-01-01
    • 2017-01-26
    • 2021-10-23
    • 1970-01-01
    • 2021-11-06
    • 1970-01-01
    相关资源
    最近更新 更多