This repository contains example of implementation go.mau.fi/whatsmeow package with Multi-Session/Account Support. This example is using a labstack/echo version 4.x.
- Multi-Session/Account Support
- Multi-Device Support
- WhatsApp Authentication (QR Code and Logout)
- WhatsApp Messaging Send Text
- WhatsApp Messaging Send Media (Document, Image, Audio, Video, Sticker)
- WhatsApp Messaging Send Location
- WhatsApp Messaging Send Contact
- WhatsApp Messaging Send Link
- And Much More ...
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment section for notes on how to deploy the project on a live system.
Prequisites packages:
- Go (Go Programming Language)
- Swag (Go Annotations Converter to Swagger Documentation)
- GoReleaser (Go Automated Binaries Build)
- Make (Automated Execution using Makefile)
Optional packages:
- Docker (Application Containerization)
-
Install Docker CE based on the manual documentation
-
Run the following command on your Terminal or PowerShell
docker run -d \
-p 3000:3000 \
--name go-whatsapp-multidevice \
--rm dimaskiddo/go-whatsapp-multidevice-rest:latest
-
Now it should be accessible in your machine by accessing
localhost:3000/api/v1/whatsapp
or127.0.0.1:3000/api/v1/whatsapp
-
Try to use integrated API docs that accesible in
localhost:3000/api/v1/whatsapp/docs/
or127.0.0.1:3000/api/v1/whatsapp/docs/
-
Download Pre-Build Binaries from the release page
-
Extract the zipped file
-
Copy the
.env.default
file as.env
file -
Run the pre-build binary
# MacOS / Linux
chmod 755 go-whatsapp-multidevice-rest
./go-whatsapp-multidevice-rest
# Windows
# You can double click it or using PowerShell
.\go-whatsapp-multidevice-rest.exe
-
Now it should be accessible in your machine by accessing
localhost:3000/api/v1/whatsapp
or127.0.0.1:3000/api/v1/whatsapp
-
Try to use integrated API docs that accesible in
localhost:3000/api/v1/whatsapp/docs/
or127.0.0.1:3000/api/v1/whatsapp/docs/
Below is the instructions to make this source code running:
- Create a Go Workspace directory and export it as the extended GOPATH directory
cd <your_go_workspace_directory>
export GOPATH=$GOPATH:"`pwd`"
- Under the Go Workspace directory create a source directory
mkdir -p src/github.com/dimaskiddo/go-whatsapp-multidevice-rest
- Move to the created directory and pull codebase
cd src/github.com/dimaskiddo/go-whatsapp-multidevice-rest
git clone -b master https://github.com/dimaskiddo/go-whatsapp-multidevice-rest.git .
- Run following command to pull vendor packages
make vendor
- Link or copy environment variables file
ln -sf .env.development .env
# - OR -
cp .env.development .env
- Until this step you already can run this code by using this command
make run
- (Optional) Use following command to build this code into binary spesific platform
make build
- (Optional) To make mass binaries distribution you can use following command
make release
-
Now it should be accessible in your machine by accessing
localhost:3000/api/v1/whatsapp
or127.0.0.1:3000/api/v1/whatsapp
-
Try to use integrated API docs that accesible in
localhost:3000/api/v1/whatsapp/docs/
or127.0.0.1:3000/api/v1/whatsapp/docs/
You can access any endpoint under HTTP_BASE_URL environment variable which by default located at .env
file.
Integrated API Documentation can be accessed in <HTTP_BASE_URL>/docs/
or by default it's in localhost:3000/api/v1/whatsapp/docs/
or 127.0.0.1:3000/api/v1/whatsapp/docs/
Currently the test is not ready yet :)
- Go - Go Programming Languange
- Swag - Go Annotations Converter to Swagger Documentation
- GoReleaser - Go Automated Binaries Build
- Make - GNU Make Automated Execution
- Docker - Application Containerization
- Dimas Restu Hidayanto - Initial Work - DimasKiddo
See also the list of contributors who participated in this project
You can seek more information for the make command parameters in the Makefile