Sample Go application demonstrating how to send RCS text messages with the Vonage Messages API. Includes JWT authentication implementation and environment configuration. Companion code for a step-by-step tutorial on building rich, interactive messaging capabilities in Go applications.
A Go application that allows you to send iRch Communications Services(RCS) text messages.
You can find full step-by-step instructions on the Vonage Developer Blog.
- Go 1.18+ installed
- ngrok installed for exposing your local server to the internet.
- Vonage Developer Account
- A registered RCS Business Messaging (RBM) Agent.
- A phone with RCS capabilities for testing.
- Clone this repo
- Initialize your Go application and install dependencies:
go mod init rcs-text-golang
go get github.com/joho/godotenv github.com/golang-jwt/jwt/v4
- Rename the
.env.example
file to.env
, and add yourVONAGE_APPLICATION_ID
andRCS_SENDER_ID
values. - Add your
private.key
file in the root of the project directory. - Start your Node server:
go run main.go
- Create a tunnel using ngrok:
ngrok http 3000
- Test your app by sending an RCS suggested reply from the command line:
curl -X POST https://YOUR_NGROK_URL/send-rcs-carousel \
-H "Content-Type: application/json" \
-d '{"to": "YOUR_RCS_TEST_NUMBER"}'