首页 > 解决方案 > 在尝试发送 Body 进行活动时,我被告知 JSON 解析不正确

问题描述

我目前正在尝试设置营销活动,但在尝试将原始文本发布到相关 API 时遇到问题。请在通过邮递员将其提交到相关端点时获得一些语法建议吗?

我已通过 JSON 验证器发送此消息,建议“第 1 行解析错误:{ % capture SKU_6d %}

期待 'STRING', '}', got 'undefined'" 即使它看起来像是填写给我的。由于格式化程序会建议我无法理解的问题,请我对此提出建议。

如下:

{
   % capture SKU_6d %
}{
    {
        "event_properties.$"{
            "product_code"x
        }
    }
}{
    "% endcapture %"
}{
   % capture SKU_4d %
}{
    {
        "event_properties.$"{
            "product_code"
        }
    }"| slice": 0,
    4
}
}{
"% endcapture %"
}{
{
    "content_blocks.$"{
        "Replenishment_SKUs"
    }
}
}{
"% if"{
    {
        "rep"
    }
}"!= blank %"
}{
"% assign rep_s ="{
    {
        "rep | times": 86400 %
    }{
        "% assign rep_date =""now""| date": "%s""| plus": {
            {
                "rep_s"
            }
        }"%"
    }{
        "% assign rep_date_ISO ="{
            {
                "rep_date"
            }
        }"| date": "%F""%"
    }{
        "attributes": [
            {
                "braze_id": "{{${braze_id}}}",
                "replenishment_{{SKU_4d}}_date": "{{rep_date_ISO}}",
                "replenishment_{{SKU_4d}}_SKU": "{{SKU_6d}}"
            }
        ]
    }{
        "% else %"
    }{
        "% abort_message() %"
    }{
        "% endif %"
    }```
Thanks

标签: jsonvalidationformatpostmanbody-parser

解决方案


推荐阅读