Connect and send messages as a whatsapp client sending REST requests, this is only for experimental use.
1. How to use locally
2. How to use on Heroku Instance
3. Testing request end-points
4. Contribute
Requirements:
- Have the go installed on your machine.
git clone https://github.com/jsdaniell/whats-api.git
go mod download || go mod vendor
go run main.go
Requirements:
- Have the heroku cli installed on your machine and logged account.
git clone https://github.com/jsdaniell/whats-api.git
heroku create {name-of-your-project}
heroku container:push -a {name-of-your-project} web
heroku container:release -a {name-of-your-project} web
curl https://{name-of-your-project}.herokuapp.com/
The response must be: Server Running...
See logs with heroku logs --tail
on the root folder of project.
GET: https://localhost:9000/getQrCode
returns the QRCode PNG on the response.
curl --location --request GET 'http://localhost:9000/getQrCode' \ --header 'Authorization: anyIDString'
GET: https://localhost:9000/disconnect
disconnect the actually logged session on the server.
curl --location --request GET 'http://localhost:9000/disconnect' \ --header 'Authorization: anyIDString'
POST: https://localhost:9000/sendMessage
send a message to some number.
curl --location --request POST 'http://localhost:9000/sendMessage' \ --header 'Authorization: anyIDString' \ --header 'Content-Type: application/json' \ --data-raw '{ "number": "558599999999", "message": "message" }'
Feel free to contribute and create suggestions about this tool, you can submit a PR anytime you want!