Feature: API Channel (#1052)

This commit is contained in:
Sojan Jose
2020-07-21 12:15:24 +05:30
committed by GitHub
parent fa04098c20
commit 8079bf50a0
40 changed files with 735 additions and 246 deletions

View File

@@ -0,0 +1,9 @@
json.payload do
json.contact do
json.partial! 'api/v1/models/contact.json.jbuilder', resource: @contact
end
json.contact_inbox do
json.inbox @contact_inbox&.inbox
json.source_id @contact_inbox&.source_id
end
end

View File

@@ -1,14 +1 @@
json.id @inbox.id
json.channel_id @inbox.channel_id
json.name @inbox.name
json.channel_type @inbox.channel_type
json.greeting_enabled @inbox.greeting_enabled
json.greeting_message @inbox.greeting_message
json.avatar_url @inbox.try(:avatar_url)
json.website_token @inbox.channel.try(:website_token)
json.widget_color @inbox.channel.try(:widget_color)
json.website_url @inbox.channel.try(:website_url)
json.welcome_title @inbox.channel.try(:welcome_title)
json.welcome_tagline @inbox.channel.try(:welcome_tagline)
json.web_widget_script @inbox.channel.try(:web_widget_script)
json.enable_auto_assignment @inbox.enable_auto_assignment
json.partial! 'api/v1/models/inbox.json.jbuilder', resource: @inbox

View File

@@ -1,19 +1,5 @@
json.payload do
json.array! @inboxes do |inbox|
json.id inbox.id
json.channel_id inbox.channel_id
json.name inbox.name
json.channel_type inbox.channel_type
json.greeting_enabled inbox.greeting_enabled
json.greeting_message inbox.greeting_message
json.avatar_url inbox.try(:avatar_url)
json.page_id inbox.channel.try(:page_id)
json.widget_color inbox.channel.try(:widget_color)
json.website_url inbox.channel.try(:website_url)
json.welcome_title inbox.channel.try(:welcome_title)
json.welcome_tagline inbox.channel.try(:welcome_tagline)
json.enable_auto_assignment inbox.enable_auto_assignment
json.web_widget_script inbox.channel.try(:web_widget_script)
json.phone_number inbox.channel.try(:phone_number)
json.partial! 'api/v1/models/inbox.json.jbuilder', resource: inbox
end
end

View File

@@ -1,14 +1 @@
json.id @inbox.id
json.channel_id @inbox.channel_id
json.name @inbox.name
json.channel_type @inbox.channel_type
json.greeting_enabled @inbox.greeting_enabled
json.greeting_message @inbox.greeting_message
json.avatar_url @inbox.try(:avatar_url)
json.website_token @inbox.channel.try(:website_token)
json.widget_color @inbox.channel.try(:widget_color)
json.website_url @inbox.channel.try(:website_url)
json.welcome_title @inbox.channel.try(:welcome_title)
json.welcome_tagline @inbox.channel.try(:welcome_tagline)
json.web_widget_script @inbox.channel.try(:web_widget_script)
json.enable_auto_assignment @inbox.enable_auto_assignment
json.partial! 'api/v1/models/inbox.json.jbuilder', resource: @inbox

View File

@@ -0,0 +1,16 @@
json.id resource.id
json.channel_id resource.channel_id
json.name resource.name
json.channel_type resource.channel_type
json.greeting_enabled resource.greeting_enabled
json.greeting_message resource.greeting_message
json.avatar_url resource.try(:avatar_url)
json.page_id resource.channel.try(:page_id)
json.widget_color resource.channel.try(:widget_color)
json.website_url resource.channel.try(:website_url)
json.welcome_title resource.channel.try(:welcome_title)
json.welcome_tagline resource.channel.try(:welcome_tagline)
json.enable_auto_assignment resource.enable_auto_assignment
json.web_widget_script resource.channel.try(:web_widget_script)
json.forward_to_address resource.channel.try(:forward_to_address)
json.phone_number resource.channel.try(:phone_number)