使用Mautic API创建电子邮件的文档如下: https://developer.mautic.org/#create-email
如果不指定参数列表,我无法创建电子邮件。 列表参数的指定如下:
列出应添加到段电子邮件的段ID数组
如何使用Python通过httppost发送参数列表,以便Mautic API不受影响?在
这将在Mautic中创建一个“template”(默认)类型的电子邮件。。。在
emailData = {
'name': 'Email-teste',
'subject': 'Assunto teste',
'isPublished': '1',
'language': 'pt_BR',`enter code here`
'customHtml' : '<strong>html do email<strong>'
}
但我需要的是创建一个“列表”类型的电子邮件。在
为此,必须指定每个列表ID。 列表是莫里斯语中的片段。。。。 我有一个ID为7的段!在
如何使用POST(Python请求)将段id发送到Mautic API?在
^{pr2}$我试过很多方法。。。我总是得到错误的答案:
u'errors': [{u'code': 400,
u'details': {u'lists': [u'This value is not valid.']},
u'message': u'lists: This value is not valid.'}]}
我确信我有一个ID为7的段,正如我在Mautic接口中看到的那样。在
我使用的是https://github.com/divio/python-mautic的修改版本
您需要将数据作为原始json发送,以下是请求示例:
秘密就在 数据=json.dumps文件(params),它将参数转换为原始json
根据链接到的API文档,
lists
必须是:但是,您没有在列表(数组)中发送
lists
的值。相反,您应该尝试:使用Python中的请求,我生成了一个url安全的有效负载字符串,其外观类似于以下截取的内容,以便将列表Id传递给分段电子邮件:
等于
^{pr2}$用简单的字体。所以你必须把[]直接放在键名后面。在
为了创建一个电子邮件列表(段电子邮件)并附加一个段,在邮递员的帮助下生成了以下代码:
考虑到您的特定问题,我可以想象您的代码应该如下所示(尽管我不熟悉您的python库):
希望这有帮助!在
相关问题 更多 >
编程相关推荐