whatsapp api error during sending an created template

Viewed 59
{ "messaging_product": "whatsapp",
 "to": "91********5", 
 "type": "template", 
 "template": {
      "name": "demo_template",
      "language": {
           "code": "en_US" 
           }
            }
             }

This is passed as a post method.

demo_template is an existing template created by me.

Getting error like this:

{
    "error": {
        "message": "(#132012) Parameter format does not match format in the created template",
        "type": "OAuthException",
        "code": 132012,
        "error_data": {
            "messaging_product": "whatsapp",
            "details": "header: Format mismatch, expected IMAGE, received UNKNOWN"
        },
        "error_subcode": 2494073,
        "fbtrace_id": "ARtWScjGa0rADjfHvbOH4bS"
    }
}
1 Answers

For image you have to first upload the image in media library then you can get id for the media you have uploded then you can attach that id with the messaging template you send out in headers in your case it is image.check this link here

or you can directly use url link to attach media.{ "type": "header", "parameters": [ { "type": "image", "image": { "link": "https://URL" } } ] },

Related