Mailchimp api v3 - 无法根据TEXT合并字段创建段

时间:2017-01-13 13:39:45

标签: php mailchimp-api-v3.0 segments

我尝试使用condition_type = TextMerge创建基于我刚创建的TEXT类型的新合并字段的片段,因为它似乎是他们的文档中与我的字段匹配的唯一选项: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/segments/#create-post_lists_list_id_segments

但是,TextMerge的描述与EmailAddress相同。更具体地说,它们都只适用于EMAIL / MERGE0字段。

TextMerge vs EmailAddress

我为'条件'

尝试了以下组合
{
    'condition_type': 'TextMerge',
    'field': 'EVENTS',
    'op': 'contains',
    'value': 'test'
}

{
    'condition_type': 'TextMerge',
    'field': 'EMAIL',
    'op': 'contains',
    'value': 'test'
}

第一个返回错误:

{
    "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":"options.conditions.item:0",
            "message":"Data did not match any of the schemas described in anyOf."
        }
    ]
}

第二个有效。

我的问题是:如何根据TEXT类型的自定义合并字段创建细分?对我而言,这看起来像是他们身边的一个小虫。有没有其他人有这个问题?有没有人有解决方案?

1 个答案:

答案 0 :(得分:0)

我终于设法解决了我的 mailchimp 受众合并标签中与 TEXT 字段相关的问题。

显然,在添加 TEXT 字段时,默认最大大小为 25 个字符。我试图将更多的文字放入其中。它失败并出现错误:

@body={
  "title"=>"Invalid Resource",
  "status"=>400,
  "detail"=>"The resource submitted could not be validated. For field-specific details, see the 'errors' array.",
  "errors"=>[{"field"=>"merge_fields.MMERGE_16",
  "message"=>"Data did not match any of the schemas described in anyOf."}]
}

我通过 Mailchimp 的 API 将字段大小增加到 255。

相关问题