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 or location
. 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 location messages using our APIs. Follow the instructions below.
connected
state and template is in approved
state, you can send your first message.
WhatsappMessageCreate.net
and paste into it this code.
src
would be your phone number registered against your WhatsApp business account. dst
would be the destination WhatsApp number that would 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.