Omnichannel - the Ruby gem for the Omnichannel API
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'
gem 'omnichannel', :git => 'https://github.com/messente/messente-omnichannel-ruby.git'
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
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 |
- Omnichannel::Channel
- Omnichannel::DeliveryReportResponse
- Omnichannel::DeliveryResult
- Omnichannel::Err
- Omnichannel::ErrorItem
- Omnichannel::ErrorResponse
- Omnichannel::MessageResult
- Omnichannel::OmniMessageCreateSuccessResponse
- Omnichannel::Omnimessage
- Omnichannel::ResponseErrorCode
- Omnichannel::ResponseErrorTitle
- Omnichannel::SMS
- Omnichannel::Status
- Omnichannel::Viber
- Omnichannel::WhatsApp
- Omnichannel::WhatsAppAudio
- Omnichannel::WhatsAppDocument
- Omnichannel::WhatsAppImage
- Omnichannel::WhatsAppText
- Type: HTTP basic authentication