POST WhatsApp Template Message
API to send the WhatsApp template message
Parameter Description
- userName: refers to the name of the user we intend to send the message
- wa_id: refers to the WhatsApp number of the user we intend to send the message NOTE: The number must contain the country code without the plus sign
- templateId: refers to the ID of the template NOTE: Template must be approved before using this API
- assingTo : refers to the email of custom user or agent.
- params: is used for the variables used in the template, it is an empty array in the case of a plain text template with no variables. In case of variables in the template, please refer to the JSON below
- tags: refers to label you can assign to conversations or chats to help organize and manage effectively.
API Endpoint
https://api.v7.botpenguin.com/whatsapp-automation/wa/send-template?apiKey=*API KEY*
Request Headers
Header | Details |
apiKey | API KEY |
Query Params
Header | Details |
apiKey | API KEY |
Body
body
JavaScript
curl --location --request POST '<https://api.v7.botpenguin.com/whatsapp-automation/wa/send-template?apiKey=> *Shared Separately*' \\
--header 'apiKey: *API KEY*' \\
--header 'Content-Type: application/json' \\
--data-raw '{
"userName": "Test",
"wa_id": "91885917****",
"templateId": "63dba1617****52face07078",
"params": [
{
"type": "header",
"parameters": [
{
"type": "document",
"document": {
"link": "<https://www.africau.edu/images/default/sample.pdf>"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Abc"
},
{
"type": "text",
"text": "def"
},
{
"type": "text",
"text": "Monday"
}
]
}
],
"assignTo": "example@gmail.com",
"tags": [ "test" ]
}'
Examples
Request
request
JavaScript
curl --location --request POST '<https://api.v7.botpenguin.com/whatsapp-automation/wa/send-template?apiKey=> *Shared Separately*' \\
--header 'apiKey: *API KEY*' \\
--header 'Content-Type: application/json' \\
--data-raw '{
"userName": "Test",
"wa_id": "91885917****",
"templateId": "63dba1617****52face07078",
"params": [
{
"type": "header",
"parameters": [
{
"type": "document",
"document": {
"link": "<https://www.africau.edu/images/default/sample.pdf>"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Abc"
},
{
"type": "text",
"text": "def"
},
{
"type": "text",
"text": "Monday"
}
]
}
],
"assignTo": "example@gmail.com",
"tags": [ "test" ]
}'
Response
Headers
Header | Details |
X-Powered-By | Express |
Vary | Origin |
Access-Control-Allow-Credentials | true |
_user | 61c1c2058e0****e9bb420f8 |
_bot | 62e77a807f1****ecce980f0 |
whatsAppId | ****bsIWcYgazd5ZDAK |
Content-Type | application/json; charset=utf-8 |
Content-Length | 7146 |
ETag | W/"1bea-RhtE+UK94qGji1CaCyMvUWBM3E8" |
Date | Wed, 03 Aug 2022 11:16:13 GMT |
Connection | keep-alive |
Keep-Alive | timeout=5 |