How to send multimedia files using the RCS channel of the Vonage Messages API.
git clone https://github.com/Vonage-Community/blog-messages-nodejs-rcs-file.git
cd blog-messages-nodejs-rcs-fileOr run in GitHub Codespaces by appending /codespaces to the URL in your browser:
https://github.com/Vonage-Community/blog-messages-nodejs-rcs-file/codespaces
npm installCopy the example file and edit it:
cp .env.example .envFill in your values for:
VONAGE_APPLICATION_ID=your-app-id
VONAGE_PRIVATE_KEY=./private.key
RCS_SENDER_ID=your-rcs-agent-id
MESSAGES_FILE_URL=https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf
PHONE_NUMBER=your-test-phone-numberDon’t forget to upload your
private.keyfile to the root of the project.
node index.jsThis will send the file specified in MESSAGES_FILE_URL to the RCS-enabled phone number.
- Node.js 18+
- A Vonage API account
- A registered RCS Business Messaging agent
- A phone with RCS support
- Try sending different file types
- Add inbound message support via webhooks
- Add JWT verification for incoming requests
Got questions? Join our Developer Slack, follow us on X (formerly Twitter), or check out our Developer Blog.