Skip to content

Restful API to dynamically generate whatsapp api urls with a custom message.

License

Notifications You must be signed in to change notification settings

rootspyro/Wa.me-Url-Generator-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wa.me Url Generator API

Restful API to dynamically generate whatsapp api urls with a custom message.

Technologies

This API is builded with the gin gonic framework.

Go WhatsApp

Install and Run the Project

1 - Install and configuration

# 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

2 - Run the project

# Run the project
go run cmd/main.go

3 - Ping Test

curl http://localhost:{port}/api/ping
# Response: {"status":"success", "data": "pong"}

4 - First Url Generation

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 Variables

# .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"]

About

Restful API to dynamically generate whatsapp api urls with a custom message.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published