class OngairRuby::ClientV1
Public Class Methods
new(token, base_url='https://ongair.im')
click to toggle source
# File lib/ongair_ruby.rb, line 8 def initialize token, base_url='https://ongair.im' @token = token @base_url = base_url end
Public Instance Methods
send_audio(external_id, audio_url, caption, thread=true)
click to toggle source
# File lib/ongair_ruby.rb, line 25 def send_audio(external_id, audio_url, caption, thread=true) response = HTTParty.post("#{@base_url}/api/v1/base/send_audio", body: {token: @token, external_id: external_id, audio_url: audio_url, caption: caption, thread: thread}) end
send_image(phone_number, image_url, name, caption="", content_type='image/jpg', thread=true, external_id=nil)
click to toggle source
# File lib/ongair_ruby.rb, line 17 def send_image(phone_number, image_url, name, caption="", content_type='image/jpg', thread=true, external_id=nil) response = HTTParty.post("#{@base_url}/api/v1/base/send_image", body: {token: @token, phone_number: phone_number, image: image_url, name: name, caption: caption, content_type: content_type, thread: thread, external_id: external_id }) end
send_text_message(phone_number, message, thread=true, external_id=nil)
click to toggle source
# File lib/ongair_ruby.rb, line 13 def send_text_message(phone_number, message, thread=true, external_id=nil) response = HTTParty.post("#{@base_url}/api/v1/base/send", body: {token: @token, phone_number: phone_number, text: message, thread: thread, external_id: external_id }) end
send_video(external_id, video_url, caption, thread=true)
click to toggle source
# File lib/ongair_ruby.rb, line 21 def send_video(external_id, video_url, caption, thread=true) response = HTTParty.post("#{@base_url}/api/v1/base/send_video", body: {token: @token, external_id: external_id, video_url: video_url, caption: caption, thread: thread}) end