facebook graph api - Error: Invalid Parameter in Meta Cloud API WhatsApp Template Request (Inactive Users, 24-Hour Window) - Sta

I am encountering an error when sending a WhatsApp message using the Meta Cloud API (v19.0) for inactiv

I am encountering an error when sending a WhatsApp message using the Meta Cloud API (v19.0) for inactive users outside the 24-hour window. Here's the error message I'm getting:

{ 
    "error": {
        "message": "(#100) Invalid parameter",
        "type": "OAuthException",
        "code": 100,
        "error_data": {
            "messaging_product": "whatsapp",
            "details": "Parameter name is missing or empty"
        },
        "fbtrace_id": "AyUmjG0DS0cEXZZwn8esb2q"
    }
}

I’ve tried sending a POST request to the Meta Cloud API with a WhatsApp template for order confirmation (without buttons) and included all required parameters in the request body. I expected the API to process the message correctly and send it to the recipient's WhatsApp number.

Here is the POST request I am sending:

POST .0/{{phone_number_id}}/messages

Body:
{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "91**********95",  // Replace with recipient's phone number
    "type": "template",
    "template": {
        "name": "order_confirmation_no_buttons",
        "language": {
            "code": "en"
        },
        "components": [
            {
                "type": "body",
                "parameters": [
                    {
                        "type": "text",
                        "text": "John Doe"  // Replace with user's first name
                    },
                    {
                        "type": "text",
                        "text": 9999  // Replace with order ID
                    },
                    {
                        "type": "text",
                        "text": "Confirmed"  // Replace with order status
                    },
                    {
                        "type": "text",
                        "text": 199  // Replace with order amount
                    }
                ]
            }
        ]
    }
}

However, I am receiving an error with the message that a parameter name is missing or empty.

I am encountering an error when sending a WhatsApp message using the Meta Cloud API (v19.0) for inactive users outside the 24-hour window. Here's the error message I'm getting:

{ 
    "error": {
        "message": "(#100) Invalid parameter",
        "type": "OAuthException",
        "code": 100,
        "error_data": {
            "messaging_product": "whatsapp",
            "details": "Parameter name is missing or empty"
        },
        "fbtrace_id": "AyUmjG0DS0cEXZZwn8esb2q"
    }
}

I’ve tried sending a POST request to the Meta Cloud API with a WhatsApp template for order confirmation (without buttons) and included all required parameters in the request body. I expected the API to process the message correctly and send it to the recipient's WhatsApp number.

Here is the POST request I am sending:

POST https://graph.facebook/v19.0/{{phone_number_id}}/messages

Body:
{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "91**********95",  // Replace with recipient's phone number
    "type": "template",
    "template": {
        "name": "order_confirmation_no_buttons",
        "language": {
            "code": "en"
        },
        "components": [
            {
                "type": "body",
                "parameters": [
                    {
                        "type": "text",
                        "text": "John Doe"  // Replace with user's first name
                    },
                    {
                        "type": "text",
                        "text": 9999  // Replace with order ID
                    },
                    {
                        "type": "text",
                        "text": "Confirmed"  // Replace with order status
                    },
                    {
                        "type": "text",
                        "text": 199  // Replace with order amount
                    }
                ]
            }
        ]
    }
}

However, I am receiving an error with the message that a parameter name is missing or empty.

Share Improve this question edited Feb 1 at 16:03 dthorbur 1,1533 gold badges13 silver badges26 bronze badges asked Jan 29 at 13:34 Suresh ChalamalaSuresh Chalamala 212 bronze badges 1
  • Welcome to Stack Overflow! It would probably be useful to read How do I format my posts using Markdown or HTML? and the Markdown help. Helpful Hint: You can click "Edit" under any question or answer to see how it was formatted. – NotTheDr01ds Commented Jan 29 at 13:35
Add a comment  | 

1 Answer 1

Reset to default 2

In the parameters array of objects, you're missing the parameter_name, you are just sending type and text but it should be like this according to the documentation:

"parameters": [ { "type": "text", "paramter_name": "customer_name", "text": "John" }, { "type": "text", "parameter_name": "order_id", "text": "9128312831" }
]

Also, if your parameter type is text, then make sure your text is double quoted, like this:

"parameters": [ { "type": "text", "parameter_name": "name_of_your_parameter_in_the_template", "text": "John Doe" // Replace with user's first name }, { "type": "text", "parameter_name": "name_of_your_parameter_in_the_template", "text": "9999" // Replace with order ID }, { "type": "text", "parameter_name": "name_of_your_parameter_in_the_template", "text": "Confirmed" // Replace with order status }, { "type": "text", "text": "199" // Replace with order amount } ]

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745295007a4621086.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信