我在使用 v3 API 在列表中创建新成员时遇到问题。我正在发送带有 json 数据的 post 请求:
网址:
https://us10.api.mailchimp.com/3.0/lists/<list-id>/members
标题:
Content-type: application/json
Authorization: apikey <my-api-key>
json体:
{
"status": "pending",
"email_address": "emai@example.com",
"merge_fields": {
"FNAME": "John",
"LNAME": "Smith",
"REFERRER": "referrer",
"REFERRAL": "referral"
}
}
它基于 api 文档和教程https://teamtreehouse.com/library/mailchimp-api/mailchimp-api/adding-new-members-to-your-list。但是每个响应看起来像:
{
"type": "http://kb.mailchimp.com/api/error-docs/400-invalid-resource",
"title": "Invalid Resource",
"status": 400,
"detail": "Your merge fields were invalid.",
"instance": "",
"errors": [
{
"field": "FNAME",
"message": "Please enter a value"
},
{
"field": "LNAME",
"message": "Please enter a value"
},
{
"field": "REFERRAL",
"message": "Please enter a value"
},
{
"field": "REFERRER",
"message": "Please enter a value"
}
]
}
我究竟做错了什么?MailChimp API 有问题吗?