header
, body
, footer
and button
. At the point of sending messages, the template object you see in the code acts as a way to pass the dynamic values within these components. header
can accomodate text
or media
(images, video, documents) content. body
can accomodate text
content. button
can support dynamic values in a url
button or to specify a developer-defined payload which will be returned when the WhatsApp user clicks on the quick_reply
button. footer
cannot have any dynamic variables.You can start sending templated WhatsApp message using our APIs. Follow the instructions below.connected
state and a template is in approved
state, you can send your first message.send_whatsapp.js
and paste into it this code.src
should be your phone number registered against your WhatsApp Business Account. dst
should be the destination WhatsApp number that you want to receive the message. auth_id
and auth_token
environment variables to avoid the possibility of accidentally committing them to source control. If you do this, you can initialize the client with no arguments and Plivo will automatically fetch the values from the environment variables. You can use process.env
to store environment variables and fetch them when initializing the client.