Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

messente/messente-omnichannel-ruby

Repository files navigation

omnichannel

Omnichannel - the Ruby gem for the Omnichannel API

Installation

Build a gem

To build the Ruby code into a gem:

gem build omnichannel.gemspec

Then either install the gem locally:

gem install ./omnichannel-1.0.0.gem

(for development, run gem install --dev ./omnichannel-1.0.0.gem to install the development dependencies)

Finally add this to the Gemfile:

gem 'omnichannel', '~> 1.0.0'

Install from Git

gem 'omnichannel', :git => 'https://github.com/messente/messente-omnichannel-ruby.git'

Getting Started

Please follow the installation procedure and then run the following code:

require 'omnichannel'
# setup authorization
Omnichannel.configure do |config|
    # Configure HTTP basic authorization: basicAuth
    config.username = '<MESSENTE_API_USERNAME>'
    config.password = '<MESSENTE_API_PASSWORD>'
end

api_instance = Omnichannel::OmnimessageApi.new
omnimessage = Omnichannel::Omnimessage.new
omnimessage.to = '<phone number in e.164 format>'
omnimessage.messages = [
    Omnichannel::SMS.new(
        {
            :sender => "<sender name or phone number in e.164 format>",
            :text => "Hello SMS!"
        }
    ),
    Omnichannel::WhatsApp.new(
        {
            :sender => "<sender name or phone number in e.164 format>",
            :text => Omnichannel::WhatsAppText.new(
                {
                    :body => "Hello from WhatsApp!",
                    :preview_url => false
                }
            )
        }
    ),
    Omnichannel::Viber.new(
        {
            :sender => "<sender name or phone number in e.164 format>",
            :text => "Hello from Viber!"
        }
    )
]

begin
    result = api_instance.send_omnimessage(omnimessage)
rescue Omnichannel::ApiError => e
    puts "Exception when calling OmnimessageApi->send_omnimessage: #{e}"
    puts e.response_body
end

Documentation for API Endpoints

All URIs are relative to https://api.messente.com/v1

Class Method HTTP request Description
Omnichannel::DeliveryReportApi retrieve_delivery_report GET /omnimessage/{omnimessage_id}/status Retrieves the delivery report for the Omnimessage
Omnichannel::OmnimessageApi cancel_scheduled_message DELETE /omnimessage/{omnimessage_id} Cancels a scheduled Omnimessage
Omnichannel::OmnimessageApi send_omnimessage POST /omnimessage Sends an Omnimessage

Documentation for Models

Documentation for Authorization

basicAuth

  • Type: HTTP basic authentication

Releases

No releases published