[go: up one dir, main page]

Skip to content

Example of using Green-API methods in Zapier. Example of sending a message.#

To launch Green-API methods, we use the "Webhooks by Zapier" actions. For example, we will call the sendMessage method using the Zap action:

  1. Create an action with the "Webhooks by Zapier" app

    Image. Click on action block

  2. Select "WebHooks by Zapier" as the Zap script trigger in the new window

    Image. Choose "WebHooks by Zapier"

  3. Select the request type according to the documentation method sendMessage

    Image. Choose request

  4. Specify the request type
    Image. Choose request
  5. Specify URL as described in the documentation:
    - apiUrl - API host link
    - mediaUrl - API host link for sending files
    - idInstance - instance unique number
    - apiTokenInstance - instance access key

    Image from documentation URL
    Image filled url

  6. If the method involves sending data, select the correct payload type and data in the request body. sendMessage has a payload type of JSON, and two fields in the request body: message and chatId

    Image filled values

  7. You may test the method by clicking the Test Step button on the Test tab.

    Image testing

Similarly, you can customize any method that is available in our documentation, which will allow you to automate interactions with our API and external services.