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.
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.
-
Select the organization where the Green-API application will be installed and click the
Install
button.
-
On the
Installed Apps
page, you can check the availability of the application in your organization.
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.
-
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.
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
.
After successful authorization, the instance should have the status
Authorized
.
You can check the status of the instance using theGetStateInstance
method.
- You will need to copy the values of
idInstance
andapiTokenInstance
for working with Make scenarios.
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
- On the scenarios page, click
Create a new scenario
to create a 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
- When using the New Message Webhook Trigger, instance setting: is automatically set
"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:
- Create a new scenario
- Click on the plus sign, in the list of applications, find Green API
- Choose one of the methods for receiving messages
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.
- In the
Create a webhook
window, clickadd
to add a connection.
- Insert the values of your instance
idInstance
andapiTokenInstance
(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
andapiTokenInstance
You can also paste the copied values from the "Setting up the Green API application" section
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, clickSave
- The connection to the added instance will be successful if Make displays your number in the format
phoneNumber@c.us
in the "Connection" list.
- To make the trigger respond to messages from any contact or chat, select
No
in theOnly From Specify Chat
field
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:
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:
-
In the
Create a webhook
window, clickSave
. Then clickOK
. -
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 themagnifying glass
icon to see which fields will be available when configuring the action.
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:
-
Send Message - sending a text message.
-
Send Contact - sending contact card.
-
Send File by Url - sending file by url.
-
Send Location - sending location.
Concise descriptions of the methods
-
Group Management:
- Create Group - Create a group chat
- Update Group Name - Change the name of a group chat
- Set Group Picture - Set the group's avatar
- Get Group Data - Get data about a group chat
- Add Group Participant - Add a participant to a group chat
- Remove Group Participant - Remove a participant from a group chat
- Set Group Admin - Appoint a participant as an administrator of a group chat
- Remove Admin - Remove admin rights from a group chat participant
-
Message Queues
- Show Messages Queue - Get a list of messages in the queue for sending
- Clear Messages Queue - Clear the message queue for sending
-
Chat Information
- Check Whatsapp - Check the availability of a WhatsApp account on a phone number
- Get Avatar - Get the avatar of a contact or group chat
- Get Contacts - Get a list of contacts from the current account
- Get Contact Info - Get information about a contact
-
Settings
- Get Settings - Get the current instance settings
- Set Settings - Set the instance settings
-
Other
- Download File - Download received and sent files
- Set Profile Picture - Set the account's profile picture
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).
Action without a trigger
- Create a new scenario
- Continue with the configuration following the next steps.
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.
-
Choose one of the methods for sending a message. For example, the SendMessage method
-
From the
Connection
list, select an existing connection or add a new one by clicking theadd
button.When adding a new connection, fill in the data for your instance,
idInstance
andapiTokenInstance
(Message sending will be done from the number associated with this instance).
Then clickSave
.
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. TheManual
option allows you to enter the number manually. TheFrom Contact List
option allows you to select a number from the contact list.
- The
Chat Id
field fill manually or select it from the contact list. When entering manually, the number should be in the formatphoneNumber@c.us
. Construct theMessage
field from the trigger fields that were initiated during the test. Then clickOK
.
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 themagnifying glass
icon to view the details of the action result.
Done! The action is configured and ready for use!