从python mailchimp api创建广告活动

时间:2018-06-25 07:43:01

标签: python mailchimp-api-v3.0

我正在使用mailchimp3 python API

from mailchimp3 import MailChimp

client = MailChimp(mc_api='', mc_user='')

client.campaigns.create(data={})

我想创建一个广告系列,但无法理解这种情况下的“数据”应该是什么。另外,我想将HTML放入电子邮件中,因此在实现此功能方面的任何帮助都会很棒。预先感谢

2 个答案:

答案 0 :(得分:2)

广告活动数据是字典类型。

format reference: line 36

data = {
    "recipients": object*
    {
        "list_id": string*
    },
    "settings": object*
    {
        "subject_line": string*,
        "from_name": string*,
        "reply_to": string*
    },
    "variate_settings": object* (Required if type is "variate")
    {
        "winner_criteria": string* (Must be one of "opens", "clicks", "total_revenue", or "manual")
    },
    "rss_opts": object* (Required if type is "rss")
    {
        "feed_url": string*,
        "frequency": string* (Must be one of "daily", "weekly", or "monthly")
    },
    "type": string* (Must be one of "regular", "plaintext", "rss", "variate", or "absplit")
}

答案 1 :(得分:0)

数据是您发送到mailchimp的api的json负载

请参阅文档以获取有关需要将哪种类型的数据发送到api的更多详细信息

参考:-https://mailchimp.com/developer/reference/

ex:-

{ “ email_address”:“ r.siva@alientt.com”, “状态”:“待定” }