class MessageQuickly::Api::ThreadSettings
Public Class Methods
greeting(text)
click to toggle source
# File lib/message_quickly/api/thread_settings.rb, line 5 def self.greeting(text) # curl -X POST -H "Content-Type: application/json" -d '{ # "setting_type":"greeting", # "greeting":{ # "text":"Welcome to My Company!" # } # }' "https://graph.facebook.com/v2.6/<PAGE_ID>/thread_settings?access_token=<PAGE_ACCESS_TOKEN>" ThreadSettings.new.greeting(text) end
Public Instance Methods
greeting(text)
click to toggle source
# File lib/message_quickly/api/thread_settings.rb, line 65 def greeting(text) json = @client.post(request_string, { setting_type: 'greeting', greeting: { text: text } }) json['result'] == "Successfully updated greeting" end
Private Instance Methods
request_string()
click to toggle source
# File lib/message_quickly/api/thread_settings.rb, line 92 def request_string "#{ENV['FACEBOOK_MESSENGER_PAGE_ID']}/thread_settings" end