API Documentation:

Wondering where to begin with Essential? If you use Ruby you can start with our API libraries.

Quick examples:

Curl

Get the default channel:

curl -X GET \
     -u '[SID]:[TOKEN]' \
     'https://api.essential.to/v2/account/channels'


Subscribers are customers (people) that belong to channels. Create a subscriber on the default channel:

curl -X POST \
     -u '[SID]:[TOKEN]' \
     -H 'Content-Type: application/json' \
     'https://api.essential.to/v2/account/subscribers' \
     -d '{ "phone_number":"15555555555", "channel":"ch_p03Gjl8Uzn0RkZSpHXHnrw" }'


Send a message to the subscriber

curl -X POST \
     -u '[SID]:[TOKEN]' \
     -H 'Content-Type: application/json' \
     'https://api.essential.to/v2/account/messages' \
     -d '{"subscriber":"sub_p03Gjl8Uzn0RkZSpHXHnrw","body":"Hello world."}'


API Libraries:

Ruby

The official Essential ruby gem is the recommended way to connect with the Essential API from a Ruby app.

Add the following line to your Gemfile.

gem 'essential'


Then run:

bundle install


Copy your phone number into this sample code and you're off!

require 'essential'

Essential.sid = 'SID'
Essential.token = 'TOKEN'
account = Essential::Account.retrieve
default_channel = account.channels.first

subscriber = default_channel.subscribers.create(
  phone_number: '2065551212'
)

message = subscriber.messages.create(body: "Hello there.")
puts message.sid


If you're having trouble finding what you're looking for, shoot us an email and we'll help you out as soon as we can.

help@essential.to