Search code examples
node.jsfacebook-graph-apiwhatsapp

Send whatsapp message without template


Is there a way to send a whatsapp message without template? I'm using the graph.facebook.com/v15.0 API and couldn't find any info about it

I'm trying this

curl --location --request POST 'https://graph.facebook.com/v15.0/{phoneId}/messages' \
--header 'Authorization: Bearer Token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "messaging_product": "whatsapp",
    "to": "anyNumber",
    "text": {
        "body": "hello world!"
    }
}'

Solution

  • Here's the error:

    I was using the wrong payload. Thanks to @turivishal. https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages

    I was also using the wrong Bearer Token.