Mailchimp API 3.0 - 批请求 [英] Mailchimp API 3.0 - batch request
问题描述
我一直在尝试使用批量端点一> mailchimp API(3.0版)的认购新用户列表,但不能使它发挥作用。
这里是要求:
I've been trying to use the batch endpoint of mailchimp API (version 3.0) to subscribe new users to a list, but can't make it work. Here is the request:
POST /3.0/batches
{
"operations": [
{
"method" : "POST",
"path" : "lists/c852ce5c86/members",
"body": "{\"email_address\":\"email@domain.tld\", \"status\":\"subscribed\"}"
}
]
}
请求似乎确定,因为我得到一个200响应:
The request seems ok cause I get a 200 response:
{
"id": "49abca6ef3",
"status": "finished",
"total_operations": 1,
"finished_operations": 1,
"errored_operations": 1,
"submitted_at": "2015-09-21T18:11:16+00:00",
"completed_at": "2015-09-21T18:11:23+00:00",
"response_body_url": "https://mailchimp-api-batch.s3.amazonaws.com/49abca6ef3-response.tar.gz?..."
}
然而,正如你可以看到,在我的批处理唯一的操作有差错。
However, as you can see, the only operation in my batch is errored.
下面是response_body_url此操作:
Here is the response_body_url for this operation:
[{
"status_code":400,
"operation_id":null,
"response":"{
\"type\":\"http://kb.mailchimp.com/api/error-docs/400-invalid-resource\",
\"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, NULL found instead\"
}]
}"
}]
这是不是非常有帮助:(
which is not very helpful :(
请注意,如果我直接命中 POST列表/ c852ce5c86 /成员
与 {EMAIL_ADDRESS:email@domain.tld,状态:订阅}
的有效载荷,它的正常工作
Note that if I directly hit POST lists/c852ce5c86/members
with {"email_address":"email@domain.tld", "status":"subscribed"}
payload, it's working properly.
推荐答案
这实际上是mailchimp API中的错误。他们到达后,他们很快就修好了。
That was actually a bug in the mailchimp API. After reaching them they quickly fixed it.
这篇关于Mailchimp API 3.0 - 批请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!