[go: up one dir, main page]

Skip to content

Integration setup#

Make is a visual design platform that allows you to automate tasks by connecting web applications (such as Discord, Slack, Gmail). Automated processes created in Make are called Scenarios.

The platform Green-API has its own application in the Make service, with which you can send Whatsapp messages.

Alternative links to the application:

If an error occurs when installing the application in Make, we recommend that you specify in the link the subdomain in which you were authorized on the site.
The subdomain determines the availability of the site via a link.
Examples of available subdomains: eu1, eu2, us1, us2.

EU1

To use the Green API application, you need to get a registration token and an instance ID in console. To test our API, we recommend using the free developer plan.

Integration Setup Procedure:
1. Setting up the Make application
2. Setting up the Green API application
3. Creating a scenario
4. Receiving a message
5. Sending a message

1. Setting up the Make application#

  • Log in or register an account on Make.
  • Install the Green-API application on Make by following this link.
  • Click the Install button.

    install

  • Select the organization where the Green-API application will be installed and click the Install button.

    install-organization

  • On the Installed Apps page, you can check the availability of the application in your organization.

    check-installed-app

2. Setting up the Green API application#

  • Log in or register an account on Green API.
  • Create an instance on the free "Developer" plan. To do this, go to console and click the Create an instance button. Then, for testing purposes, select the "Developer" plan.

create-instance

developer

  • Authorize the phone. To do this:

    You can scan the QR code on the instance setup page. In the WhatsApp mobile app or WhatsApp Business, log in to the linked devices and scan the QR code received.

    scan-qr

    Or request a six-digit authorization code to be bound by phone number. In the WhatsApp mobile app or WhatsApp Business, log in to linked devices and tap Link with phone number instead.

    scan-qr

After successful authorization, the instance should have the status Authorized.
You can check the status of the instance using the GetStateInstance method.

  • You will need to copy the values of idInstance and apiTokenInstance for working with Make scenarios.

console

3. Creating a scenario#

Scenario - an automated process created in Make. Each scenario consists of a trigger and an action. When the trigger is activated in one of the Make applications, it automatically performs an action in another."

Algorithm for creating a scenario:

  • Log in or register an account on Make
  • In the sidebar menu, click on the Scenarios button

go-to-scenarios

  • On the scenarios page, click Create a new scenario to create a new scenario

create-new-scenario

Important

After creating the scenario, you will see a plus sign (add application) on the Make page.

To automatically activate your scenario, you need to first configure the trigger (for activating the scenario when receiving a message) and then set up the corresponding action (for automatically sending a message).

The scenario has been successfully created!

4. Receiving a message#

To receive messages in Make, you need to configure a trigger.

Trigger - this is an event that activates your scenario. For example, it could be a new message in WhatsApp, a new entry in Google Sheets, or something else.

In the Green API application, there are two types of triggers implemented for receiving messages:
1. New Message Webhook
2. Last Incoming Messages

1. New Message Webhook#

New Message Webhook - the trigger fires on receiving a new incoming WhatsApp message. The trigger is based on webhooks.

Advantages:
+ Minimum trigger activation time
+ More detailed information about incoming messages

Disadvantages:
- The trigger can be used only for one integration on one Green API instance
- If you manually change the instance settings, the trigger may also react to notifications other than incoming messages

Instance settings
"webhookUrl": "webhookserver make",
"incomingWebhook": "yes"

2. Last Incoming Messages#

Last Incoming Messages - the trigger fires on receiving a new incoming WhatsApp message. The trigger is based on the lastIncomingMessages method.

Advantages:
+ This trigger can be used for different integrations on one Green API instance
+ The trigger only reacts to incoming messages

Disadvantages:
- The trigger activation time is determined by the time the message is added to the log and the frequency of requests by the Make service (depends on the type of Make account)

Instance settings
  • When using the Last Incoming Messages trigger, instance setting: is automatically set
"incomingWebhook": "yes"

Trigger Configuration#

Procedure for Configuring the Trigger:

green-api-application-search

  • Choose one of the methods for receiving messages

triggers

Trigger Tags

In Make, the tag 'ACID' is used to mark trigger methods. In our case, the trigger methods are methods for receiving messages.
Description of methods.

  • Click add to add the address from which webhooks will be received.

add-webhook

  • In the Create a webhook window, click add to add a connection.

create-webhook

  • Insert the values of your instance idInstance and apiTokenInstance (Message retrieval will be performed from the number associated with this instance)
Instance values
  • Log in to Green API console
  • Go to the instance settings by clicking on the desired instance from the list
  • Copy the values of idInstance and apiTokenInstance

You can also paste the copied values from the "Setting up the Green API application" section

make-green-api-form

The Connection name field

The "Connection name" field can be used to name the added instance (e.g., 'work number' or 'sales').
This will allow you to easily find the desired account in the list of available integrations when creating integrations.

  • In the Create a connection window, click Save
  • The connection to the added instance will be successful if Make displays your number in the format phoneNumber@c.us in the "Connection" list.

successful-test

  • To make the trigger respond to messages from any contact or chat, select No in the Only From Specify Chat field

specify-chat-no

A specific contact

To make the trigger respond to messages from a specific contact, select Yes in the Only From Specify Chat field.

  • Choose Manual to enter the number manually:

specify-chat-yes-manual

When entering the number manually, it should be in the format phoneNumber@c.us. For example: 0100123456789@c.us.

phoneNumber should be the full phone number in international format. Do not use plus signs, zeros, parentheses, or dashes when entering the phone number in international format.

  • Choose From Contact List to select a number from your contact list:

specify-chat-yes-contactlist

  • In the Create a webhook window, click Save. Then click OK.

  • Perform a test by clicking the Run once button. If there are incoming messages in the selected chat and the test is successful, click on the magnifying glass icon to see which fields will be available when configuring the action.

test-trigger

Done! The trigger is configured and ready for use!

5. Sending a message#

To send messages, you need to configure the action in Make.

Add the actions that should be performed after the trigger is activated. These can include sending messages, filling in cells, updating data, or other actions in other applications or services.

Action configuration should be done after configuring the trigger so that messages are sent automatically.

Additionally, you can configure only the action without a trigger. In this case, you will need to manually initiate the scenario.

Actions#

All actions repeat Green API methods, you can read more about Green API methods in documentation.

Methods of sending messages:

Concise descriptions of the methods
  1. Group Management:

  2. Message Queues

  3. Chat Information

  4. Settings

  5. Other

Action Configuration#

Procedure for Configuring the Action:

  • To add an action, click on the semicircle next to the trigger. This will bring up an empty gray circle with a plus sign (add application).
    add-action
Action without a trigger

Note: In this case, you will need to manually initiate the scenario

  • Select the application to execute the action. To do this, find Green API in the list of applications.

    empty-action

  • Choose one of the methods for sending a message. For example, the SendMessage method

    send-message

  • From the Connection list, select an existing connection or add a new one by clicking the add button.

    When adding a new connection, fill in the data for your instance, idInstance and apiTokenInstance (Message sending will be done from the number associated with this instance).
    Then click Save.

connection-action

The Connection name field

The "Connection name" field can be used to name the added instance (e.g., 'work number' or 'sales').
This will allow you to easily find the desired account in the list of available integrations when creating integrations.

  • In the Chat ID source field, choose a convenient way to enter the chat number. The Manual option allows you to enter the number manually. The From Contact List option allows you to select a number from the contact list.

chat-id

  • The Chat Id field fill manually or select it from the contact list. When entering manually, the number should be in the format phoneNumber@c.us. Construct the Message field from the trigger fields that were initiated during the test. Then click OK.

chat-id-and-message

phoneNumber

phoneNumber should be the full phone number in international format.
Do not use plus signs, zeros, parentheses, or dashes when entering the phone number in international format.
For example: 0100123456789@c.us.

  • Perform a test by clicking the Run once button. If the test is successful, click on the magnifying glass icon to view the details of the action result.

test-action

Done! The action is configured and ready for use!

Examples of using the Green API application#

How to make messaging between WhatsApp and Slack

How to make messaging between WhatsApp and Discord