最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

json - WhatsApp Flow template receives empty dynamic data from flow_action_data - Stack Overflow

programmeradmin2浏览0评论

I'm integrating WhatsApp Flows with a message template using the WhatsApp Cloud API. My goal is to send dynamic data inside flow_action_data, but when I receive the Flow, all dynamic fields appear empty.

The message is received in WhatsApp, and the button correctly opens the Flow. The problem: The Flow is completely empty. None of the dynamic values from flow_action_data are appearing.

But when i send only the flow (without the template), works fine:/

Steps I followed: I created a message template (test_extremo_wa) that includes a Flow button. I attached the Flow ID (xxxxxx) in the template. I sent the message using the following API request:

THE JSON FLOW:

{
  "version": "6.0",
  "screens": [
    {
      "id": "RATE_SERVICE",
      "title": "${data.title_rate_service}",
      "data": {
        "title_rate_service": {
          "type": "string",
          "__example__": "Califica tu experiencia"
        },
        "subtitle_rate_service": {
          "type": "string",
          "__example__": "¿Cómo calificarías este servicio?"
        },
        "service_name": {
          "type": "string",
          "__example__": "Servicio dinámico"
        },
        "label_rating": {
          "type": "string",
          "__example__": "Tu calificación:"
        },
        "button_next": {
          "type": "string",
          "__example__": "Siguiente"
        },
        "text_excellent": {
          "type": "string",
          "__example__": "★★★★★ • Excelente"
        },
        "text_good": {
          "type": "string",
          "__example__": "★★★★☆ • Bueno"
        },
        "text_average": {
          "type": "string",
          "__example__": "★★★☆☆ • Regular"
        },
        "text_bad": {
          "type": "string",
          "__example__": "★★☆☆☆ • Malo"
        },
        "text_very_bad": {
          "type": "string",
          "__example__": "★☆☆☆☆ • Muy Malo"
        },
        "title_comment_screen": {
          "type": "string",
          "__example__": "Tu opinión cuenta"
        },
        "comment_text": {
          "type": "string",
          "__example__": "Cuéntanos más sobre tu experiencia."
        },
        "label_comment": {
          "type": "string",
          "__example__": "Comentarios:"
        },
        "button_submit": {
          "type": "string",
          "__example__": "Enviar"
        }
      },
      "layout": {
        "type": "SingleColumnLayout",
        "children": [
          {
            "type": "Form",
            "name": "form",
            "children": [
              {
                "type": "TextSubheading",
                "text": "${data.subtitle_rate_service}"
              },
              {
                "type": "TextCaption",
                "text": "${data.service_name}"
              },
              {
                "type": "RadioButtonsGroup",
                "name": "rating",
                "label": "${data.label_rating}",
                "data-source": [
                  { "id": "5", "title": "${data.text_excellent}" },
                  { "id": "4", "title": "${data.text_good}" },
                  { "id": "3", "title": "${data.text_average}" },
                  { "id": "2", "title": "${data.text_bad}" },
                  { "id": "1", "title": "${data.text_very_bad}" }
                ],
                "required": true
              },
              {
                "type": "Footer",
                "label": "${data.button_next}",
                "on-click-action": {
                  "name": "navigate",
                  "next": {
                    "type": "screen",
                    "name": "COMMENT_SCREEN"
                  },
                  "payload": {
                    "rating": "${form.rating}",
                    "service_name": "${data.service_name}",
                    "title_comment_screen": "${data.title_comment_screen}",
                    "comment_text": "${datament_text}",
                    "label_comment": "${data.label_comment}",
                    "button_submit": "${data.button_submit}"
                  }
                }
              }
            ]
          }
        ]
      }
    },
    {
      "id": "COMMENT_SCREEN",
      "title": "${data.title_comment_screen}",
      "data": {
        "rating": {
          "type": "string",
          "__example__": "★★★★★"
        },
        "service_name": {
          "type": "string",
          "__example__": "Servicio dinámico"
        },
        "comment_text": {
          "type": "string",
          "__example__": "Cuéntanos más sobre tu experiencia."
        },
        "label_comment": {
          "type": "string",
          "__example__": "Comentarios:"
        },
        "button_submit": {
          "type": "string",
          "__example__": "Enviar"
        }
      },
      "layout": {
        "type": "SingleColumnLayout",
        "children": [
          {
            "type": "Form",
            "name": "form",
            "children": [
              {
                "type": "TextBody",
                "text": "${datament_text}"
              },
              {
                "type": "TextArea",
                "label": "${data.label_comment}",
                "name": "comment",
                "required": false
              },
              {
                "type": "Footer",
                "label": "${data.button_submit}",
                "on-click-action": {
                  "name": "complete",
                  "payload": {
                    "rating": "${data.rating}",
                    "service_name": "${data.service_name}",
                    "comment": "${formment}"
                  }
                }
              }
            ]
          }
        ]
      },
      "terminal": true
    }
  ]
}`

AND THE POSTMAN REQUEST:

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "my phone jeje",
  "type": "template",
  "template": {
    "name": "test_extremo_wa",
    "language": {
      "code": "en"
    },
    "components": [
      {
        "type": "button",
        "sub_type": "flow",
        "index": "0",
        "parameters": [
          {
            "type": "payload",
            "payload": "{\"flow_token\": \"1234567890abcdef\", \"flow_action_data\": {\"title_rate_service\": \"Califica tu experiencia\", \"subtitle_rate_service\": \"¿Cómo calificarías este servicio?\", \"service_name\": \"Servicio dinámico\", \"label_rating\": \"Tu calificación:\", \"button_next\": \"Siguiente\", \"text_excellent\": \"★★★★★ • Excelente\", \"text_good\": \"★★★★☆ • Bueno\", \"text_average\": \"★★★☆☆ • Regular\", \"text_bad\": \"★★☆☆☆ • Malo\", \"text_very_bad\": \"★☆☆☆☆ • Muy Malo\", \"title_comment_screen\": \"Tu opinión cuenta\", \"comment_text\": \"Cuéntanos más sobre tu experiencia.\", \"label_comment\": \"Comentarios:\", \"button_submit\": \"Enviar\"}}"
          }
        ]
      }
    ]
  }
}
发布评论

评论列表(0)

  1. 暂无评论