Cannot create segment using MailChimp API v3

前端 未结 2 493
花落未央
花落未央 2021-01-12 19:47

I\'m using the \"playground\" to test creating a segment but I keep getting validations errros

my request:

{
    \"name\": \"MyTest\",
    \"options\         


        
相关标签:
2条回答
  • 2021-01-12 20:06

    Actually the format of the JSON should be as following:

    {
        "name":"email based",
        "options":{
                    "match": "any",
                    "conditions":[
                                    {
                                        "condition_type":"EmailAddress",
                                        "field":"merge0",
                                        "op":"is",
                                        "value":"p001@mymaildomain.xxx"
                                    },
                                    {
                                        "condition_type":"EmailAddress",
                                        "field":"merge0",
                                        "op":"is",
                                        "value":"p002@mymaildomain.xxx"
                                    }
                    ]
        }
    
    0 讨论(0)
  • 2021-01-12 20:20

    For others also having this issue, it also occurs when you do not provide a key / value for all defined merge fields. It can also happen if you use different case when passing in merge fields. So if you have the following merge fields defined, whether they're set as required or not :

    Age Gender

    Make sure you always pass in key/value pairs for both Age and Gender, using that exact same case. If you only pass in "Age=25" or "age=25", without passing in "Gender=", the above described error will occur, because it is not a well designed API.

    0 讨论(0)
提交回复
热议问题