Getting a problem while sending the whatsapp flow as a template with the data - Stack Overflow

admin2025-04-18  0

I am sending a template with a flow, and I want to send a payload. Therefore it needs to exchange data to initialize the flow. It gives me below error. Also someone reported the issue in meta also check this link. Does anyone have idea how to fix this issue?

Request URL 
.0/{{Phone-Number-ID}}/messages

Request Body

{
    "messaging_product": "whatsapp",
    "to": "4234234234",
    "type": "template",
    "template": {
        "name": "order_completation_without_registered_user",
        "language": {
            "code": "en_US"
        },
        "components": [
            {
                "type": "button",
                "sub_type": "flow",
                "index": "0",
                "parameters": [
                    {
                        "type": "action",
                        "action": {
                            "flow_token": "234234234",
                            "flow_action_data": {
                                "is_registered_user": true
                            }
                        }
                    }
                ]
            }
        ]
    }
}

Below Error

{
    "error": {
        "message": "(#131009) Parameter value is not valid",
        "type": "OAuthException",
        "code": 131009,
        "error_data": {
            "messaging_product": "whatsapp",
            "details": "Unexpected key \"flow_action_payload\" when \"flow_action\" is \"data_exchange\"."
        },
        "fbtrace_id": "AnVLLVsSsEu7O6HPeKeem85"
    }
}

I am sending a template with a flow, and I want to send a payload. Therefore it needs to exchange data to initialize the flow. It gives me below error. Also someone reported the issue in meta also check this link. Does anyone have idea how to fix this issue?

Request URL 
https://graph.facebook/v21.0/{{Phone-Number-ID}}/messages

Request Body

{
    "messaging_product": "whatsapp",
    "to": "4234234234",
    "type": "template",
    "template": {
        "name": "order_completation_without_registered_user",
        "language": {
            "code": "en_US"
        },
        "components": [
            {
                "type": "button",
                "sub_type": "flow",
                "index": "0",
                "parameters": [
                    {
                        "type": "action",
                        "action": {
                            "flow_token": "234234234",
                            "flow_action_data": {
                                "is_registered_user": true
                            }
                        }
                    }
                ]
            }
        ]
    }
}

Below Error

{
    "error": {
        "message": "(#131009) Parameter value is not valid",
        "type": "OAuthException",
        "code": 131009,
        "error_data": {
            "messaging_product": "whatsapp",
            "details": "Unexpected key \"flow_action_payload\" when \"flow_action\" is \"data_exchange\"."
        },
        "fbtrace_id": "AnVLLVsSsEu7O6HPeKeem85"
    }
}
Share Improve this question asked Mar 6 at 15:50 OnPrint CloudOnPrint Cloud 12 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Did you create the flow templates with "flow_action": "data_exchange"? In that case, you can't pass flow_action_data when sending the template as the flow will populate the initial data from your endpoint anyway.

If you need to include some data during sending the template, you can encode it the flow_token or store it in your backend in advance.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1744964547a277114.html

最新回复(0)