class OngairRuby::ClientV2

Public Class Methods

new(token, base_url='https://ongair.im') click to toggle source
# File lib/ongair_ruby.rb, line 31
  def initialize token, base_url='https://ongair.im'
          @token = token
@base_url = base_url
  end

Public Instance Methods

send_chain(external_id, messages, thread=true) click to toggle source

Send a chain of messages including options

@example

messages=[{ text: 'Hi'}, { text: 'Question?', options: [“1,2”]} ]

# File lib/ongair_ruby.rb, line 50
def send_chain(external_id, messages, thread=true)
  HTTParty.post("#{@base_url}/api/v1/base/send_chain", body: {token: @token, external_id: external_id, messages: messages, thread: thread })
end
send_image(external_id, image_url, content_type, caption=nil, options=nil, thread=true) click to toggle source
# File lib/ongair_ruby.rb, line 40
def send_image(external_id, image_url, content_type, caption=nil, options=nil, thread=true)
  HTTParty.post("#{@base_url}/api/v1/base/send_image", body: {token: @token, external_id: external_id, caption: caption, image: image_url, thread: thread, options: options })
end
send_location_prompt(external_id, text, thread=true) click to toggle source
# File lib/ongair_ruby.rb, line 58
def send_location_prompt(external_id, text, thread=true)
  HTTParty.post("#{@base_url}/api/v1/base/send_location_prompt", body: {token: @token, external_id: external_id, text: text, thread: thread })
end
send_message(external_id, message, options=nil, thread=true) click to toggle source
# File lib/ongair_ruby.rb, line 36
def send_message(external_id, message, options=nil, thread=true)
  HTTParty.post("#{@base_url}/api/v1/base/send", body: {token: @token, external_id: external_id, text: message, thread: thread, options: options })
end
send_telephone_prompt(external_id, text, thread=true) click to toggle source
# File lib/ongair_ruby.rb, line 54
def send_telephone_prompt(external_id, text, thread=true)
  HTTParty.post("#{@base_url}/api/v1/base/send_telephone_prompt", body: {token: @token, external_id: external_id, text: text, thread: thread })
end