Mailchimp API v3-使用merge_fields将成员添加到列表 [英] Mailchimp api v3 - add member to list with merge_fields
本文介绍了Mailchimp API v3-使用merge_fields将成员添加到列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我通过HTTP POST发送此对象:
I send this object as HTTP POST:
{
"email_address": "rickard@transticket.se",
"status": "subscribed",
"merge_fields": {
"APA": "1",
"HEJ": "2"
}
}
发送至 https://us13.api.mailchimp.com/3.0/lists/045dfc0a43/members
我得到了这个答复:
{
"type": "http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/",
"title": "Invalid Resource",
"status": 400,
"detail": "The resource submitted could not be validated. For field-specific details, see the 'errors' array.",
"instance": "",
"errors": [ {
"field": "",
"message": "Schema describes object, array found instead"
}]
}
有什么想法吗?
推荐答案
这很容易,您的代码POST请求正确.也许合并"字段在您的列表中不存在. merge_fields 参数采用带有一些预定义键的字典.见下文.
This is quite easy and your code POST request is right. Maybe the Merge fields don't exist in your list. The merge_fields parameter takes a dict with some pre-defined keys. See below.
{
apikey: "yourmailmergekey"
email_address: "test_email@gmail.com"
status: "subscribed"
merge_fields: {
"FNAME: "-- First Name --",
"LNAME": "-- Last Name --",
"PHONE": "-- Phone Number --",
"ADDRESS": "-- Address --"
}
}
希望有帮助
这篇关于Mailchimp API v3-使用merge_fields将成员添加到列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文