lib/stealth/services/smooch/client.rb in stealth-smooch-0.9.1 vs lib/stealth/services/smooch/client.rb in stealth-smooch-1.0.0
- old
+ new
@@ -31,11 +31,11 @@
Stealth::Logger.l(topic: 'smooch', message: msg)
raise Stealth::Errors::ServiceError
end
if response.present?
- Stealth::Logger.l(topic: "smooch", message: "Message #{response.message._id} successfully sent.")
+ Stealth::Logger.l(topic: "smooch", message: "Message #{response.message.id} successfully sent.")
end
end
def self.generate_jwt_token
payload = { scope: 'app' }
@@ -64,10 +64,10 @@
def self.set_persistent_menu(menu)
smooch_api = SmoochApi::IntegrationApi.new
response = smooch_api.list_integrations(Stealth.config.smooch.app_id)
response.integrations.each do |integration|
begin
- smooch_api.update_integration_menu(Stealth.config.smooch.app_id, integration._id, menu)
+ smooch_api.update_integration_menu(Stealth.config.smooch.app_id, integration.id, menu)
puts "#{Stealth::Logger.colorize('[Persistent Menu]', color: :green)} set for #{integration.type} integration."
rescue SmoochApi::ApiError
# Not all integrations support the persistent menu
puts "#{Stealth::Logger.colorize('[Persistent Menu]', color: :red)} Skipping #{integration.type} integration. Persistent Menu is not supported."
next