APIs & Webhooks
Send Template Message via API
Guide on how to send a template message via API
You can use the send template message to a phone number using the following API. Details of this API can be found in its API documentation page
Url
Use POST http method with the following url
https://api.chakrahq.com/v1/ext/plugin/whatsapp/{pluginId}/phoneNumber/{phoneNumber}/send-template-messageNeed to provide 2 url patameters
- pluginId (how to find the pluginId)
- phoneNumber - The phone number to whom the template message is to be sent
Headers
Need to provide an authorization header
- Authorization: Bearer \[accessToken]
Learn how to generate an access token
Request Body
Following is an example of the request body to send a sample template message
Request body keys:
- whatsappPhoneNumberId - The Meta WhatsApp Phone Number Id (Learn how to find this id)
- templateName - the name of your message template
- mapping - Template mapping object
{ "whatsappPhoneNumberId": "775966265503012", "templateName": "christmas_promo_23", "mapping": [ { "schemaPropertyName": "1", "schemaPropertyValue": "John" } ], "imageUrl": "https://chakra-public-media.chakrahq.com/5fc9f8e3-af4a-4f29-bfd8-6c02e3abe3ee/2024-10-17/9b755981-74f7-4cde-b495-cd7039991964.png"}More details of this API can be found in its API documentation page