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"
}
}
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.