The code found in main.go
provides two urls /send-sms
and /webhook/inbound-sms
.
Triggering /send-sms
will send an SMS to the To
number defined in .env
.
Table of Contents
Run the following two commands to clone this repository and change directory into the repository directory.
git clone https://github.com/GregHolmes/send-and-receive-sms-in-go-with-vonage
cd send-and-receive-sms-in-go-with-vonage
Rename the .env.example
file to .env
and populate the values. The VONAGE_API_KEY and VONAGE_API_SECRET can be found on your Dashboard.
VONAGE_API_KEY=
VONAGE_API_SECRET=
FROM=<Your Vonage number>
TO=<The recipients number>
To install the libraries used, run the following commands:
go get github.com/gorilla/mux
go get github.com/gorilla/schema
go get github.com/joho/godotenv
go get github.com/nexmo-community/nexmo-go
Go to: http://localhost:8080/send-sms in your browser, if configured correctly, you should have sent yourself an SMS. Check your phone!
In the interest of fostering an open and welcoming environment, we strive to make participation in our project and our community a harassment-free experience for everyone. Please check out our Code of Conduct in full.
We ❤️ contributions from everyone! Check out the Contributing Guidelines for more information.
This project is subject to the MIT License