MailChimp.发送添加新列表成员的请求时出现错误401(未经授权) [英] MailChimp. Error 401 (Unauthorized) when sending a request for adding a new list member

查看:101
本文介绍了MailChimp.发送添加新列表成员的请求时出现错误401(未经授权)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我尝试发送请求的方式:

Here is how I'm trying to send a request:

fetch('https://us17.api.mailchimp.com/3.0/lists/185415c92c/members', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': 'anystring:8ec49e64f2041073d3fe56e0abc5fe5f-us17',
      },
      body: JSON.stringify({
        email_address: 'email@mail.ru',
        status: 'subscribed',
      }),
      mode: 'no-cors',
    })

我得到这样的错误:

POST https://us17.api.mailchimp.com/3.0/lists/185415c92c/members 401(未经授权)

我在做什么错了?

推荐答案

我一直遇到同样的问题,我在帐户设置中从MailChimp检查了我的密钥.在KEY下,它说我的钥匙已被禁用",在LABEL下,它说公开发布,请勿启用".有时,这不是我们的代码,而是密钥本身.尝试检查您当前正在使用的密钥.

I kept having the same issue, I checked my Key from MailChimp in my account setting. Under KEY, it said my key "was disabled" and under LABEL it said "posted in public, do not enable". Sometimes it's not our code, it's the key itself. Try checking the key you are currently using.

这篇关于MailChimp.发送添加新列表成员的请求时出现错误401(未经授权)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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