Skip to content

Building and installation on Windows#

1. Setting up the environment#

To build the app you need:

  • git - a cross-platform utility used on this project for downloading libraries.
  • CMake - a cross-platform utility for automatically building software from source code.
  • Compiler Microsoft Visual C++ (MSVC) for C++ applications.

cmake and git must be accessible by PATH.

2. Building#

Do a git clone to download the project and change into the directory. The build is done by running the build.bat script (or .\build.bat for Powershell):

git clone --branch=master --depth=1 https://github.com/green-api/whatsapp-api-webhook-server-cpp
cd whatsapp-api-webhook-server-cpp
build.bat

Application is built at Release config by default. Config file config.json and directory jsonSchema are copied to build\bin directory. The application prioritize build\bin files over project's directory.

After successful build you can build it using build.bat or

cmake --build build --config=Release

3. Run the application#

The application binary is placed in build/bin/.
During the application build process, the configuration file is copied to the build\bin directory. The server first looks for a file in this directory when it starts, loading config.json from the project-wide directory only if it is not in build\bin.

Run the application:

build\bin\whatsapp-api-webhook-server-cpp.exe

Server exposes port from config.json configuration (by default: 5000).

To test the server you can use Postman collection.

Video-instruction#