Restful API to dynamically generate whatsapp api urls with a custom message.
This API is builded with the gin gonic framework.
# Clone the repo
git clone https://github.com/rootspyro/Wa.me-Url-Generator-API.git
cd Wa.me-Url-Generator-API
# Install modules
go mod tidy
# Create the env file
touch .env
Note: Read the .env.example file
# Run the project
go run cmd/main.go
curl http://localhost:{port}/api/ping
# Response: {"status":"success", "data": "pong"}
curl -XPOST -H "Content-type: application/json" -d '{
"phone":"+12225556666",
"msg":"Hello World!"
}' 'http://localhost:3000/ws/url'
# Response: {"status":"success", "data":{"contact-phone":"+12225556666","msg":"Hello World!","url":"https://wa.me/+12225556666?text=Hello%20World!"}}
# Generated Url: https://wa.me/+12225556666?text=Hello%20World!
# .env file
# CONFIG
PORT=3000
# CORS
ALLOWED_ORIGINS="*"
# EXAMPLE:
# ALLOWED_ORIGINS="http://localhost,https://some.domain.com,https://another.domain.com"
# result array: ["http://localhost", "https://some.domain.com", "https://another.domain.com"]