Send WhatsApp Message Templates from Zapier

Ana Updated by Ana

In this article, we will see how to send an HSM Template using Landbot API and Zapier. A common use case is when you have your opt-in leads stored in an external database and then you need to send the template using that already stored data.

In the following example, we will imagine that our opt-in leads are stored in Google Sheets and that we are going to send a template every time a new row is completed.

  1. After the trigger, setup a Webhook with a Custom Request, then press Continue:

  1. Then, we will follow the information we get from the Message Template section of the WhatsApp channel to setup the action:

  • Method: POST
  • URL: https://api.landbot.io/v1/customers/:customerID/send_template/
  • Replace :customerID for the data you get from your Google Sheets.
  • Data Pass-Through? = False
  • In Data, we will paste what we have under --data-raw:
    If our template has params, you can use Google Sheet data to complete them:

  1. Scroll down the Zap and complete the Headers.

- Authorization: Token XXXXXXXXXXX. Get your API TOKEN from here.

- Content-Type: application/json

  1. Press Continue and it's done! You can test your Zap to be sure there are no errors in the configuration.

Extra step for HSM template with buttons

In the case your template has buttons and you want to know what your lead chooses from the bot that is linked to your WhatsApp channel, you will need to add an extra action to make an unassign request to prevent the chat from being assigned to an agent, which would block the execution of the bot. 

  1. Duplicate your Custom Request:

  1. Complete the action with the following information:
  • In Method select PUT
  • URL: https://api.landbot.io/v1/customers/:customerID/unassign/
  • Replace :customerID for the data you get from your Google Sheets.
  • In Headers add the same values as above.
  • Data field must be empty.

You can see the unassign request configuration from our API docs.

How did we do?

How to generate a document with PDFMonkey by Zapier

How to send an email with Gmail by Zapier

Contact