How to send WhatsApp Messages from Google Apps Script

Using the WhatsMate WA Gateway REST API

This article shows you how to send a WhatsApp message from a Google Apps Script.

Before the recipient can receive your WhatsApp message, she will need to register with the WhatsMate WA Gateway. Instructions are available on the official site. Unregistered users will NEVER receive messages from the Gateway.

To send a WhatsApp message from a Google Apps Script, do this:

  1. Copy the following source code to your Apps Script project.
  2. Customize the TODO lines:
    • Specify your gateway instance ID on line 9.
    • Specify your client ID and secret on lines 10 and 11.
    • Specify your target recipient on line 2. Remember to include the country code.
    • Specify your message on line 3.
  3. Run the function main() to send your message.

You will need a trial account to call the above API. Go sign up now.