Sending SMS Messages

Prerequisites

Before proceeding, ensure you have obtained a phone number and API key as described in the prerequisites.

Installation

Create a Gemfile in your project root:

1source "https://rubygems.org"
2gem "dotenv"
3gem "rcs", "2.0.0.pre.rc.5"

Install the dependencies:

$bundle install

This guide uses version rcs 2.0.0.pre.rc.5. Requires Ruby version >= 2.7.0

Configuration

Create an .env file in your project root and add your Pinnacle API key:

PINNACLE_API_KEY="your_api_key" # pnclk_
SENDER_NUMBER="your_phone_number" # +12345678910

Sending Your First SMS

Create a new Ruby file (e.g., send_sms.rb) and add the following code to the right.

Run the script:

$ruby send_sms.rb

If successful, the recipient will receive your SMS message!