Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.com/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.

like image 443
Suresh Chalamala Avatar asked Sep 16 '25 23:09

Suresh Chalamala


1 Answers

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
   }
]
like image 171
Miguel García Avatar answered Sep 19 '25 23:09

Miguel García