我对mailchimp取消订阅过程有疑问。
请您为我提供退订流程的方法。如何准确地放入退订列表以及我应该请求哪些文件。以及我如何知道应将电子邮件放入退订列表的区别。
mailchimp.post('/lists/{id}', {
email_address : "[email protected]"
})
.then(function(results) {
console.log(results)
})
.catch(function (err) {
console.log(err)
});
响应错误
{ Error: The resource submitted could not be validated. For field-specific details, see the 'errors' array.
at Request._callback (/Users/Gizbreht/Desktop/myofer-mailer-express/node_modules/mailchimp-api-v3/index.js:506:30)
at Request.self.callback (/Users/Gizbreht/Desktop/myofer-mailer-express/node_modules/request/request.js:187:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/Users/Gizbreht/Desktop/myofer-mailer-express/node_modules/request/request.js:1126:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (/Users/Gizbreht/Desktop/myofer-mailer-express/node_modules/request/request.js:1046:12)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
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: 'Required fields were not provided: members' } ] }
最佳答案
mailchimp.post('/lists/{id}', {
"members" : [{"email_address": email, "status": "unsubscribed"}],"update_existing":true
})
.then(function(results) {
console.log(results)
})
.catch(function (err) {
console.log(err)
});