v3 API を使用してリストに新しいメンバーを作成する際に問題が発生しました。私はjsonデータでポストリクエストを送信しています:
URL:
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 に問題がありますか?