feat: Add Public APIs for API Channel (#2375)
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
json.source_id @contact_inbox.source_id
|
||||
json.partial! 'public/api/v1/models/contact.json.jbuilder', resource: @contact_inbox.contact
|
||||
@@ -0,0 +1,2 @@
|
||||
json.source_id @contact_inbox.source_id
|
||||
json.partial! 'public/api/v1/models/contact.json.jbuilder', resource: @contact_inbox.contact
|
||||
@@ -0,0 +1,2 @@
|
||||
json.source_id @contact_inbox.source_id
|
||||
json.partial! 'public/api/v1/models/contact.json.jbuilder', resource: @contact_inbox.contact
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! 'public/api/v1/models/conversation.json.jbuilder', resource: @conversation
|
||||
@@ -0,0 +1,3 @@
|
||||
json.array! @conversations do |conversation|
|
||||
json.partial! 'public/api/v1/models/conversation.json.jbuilder', resource: conversation
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! 'public/api/v1/models/message.json.jbuilder', resource: @message
|
||||
@@ -0,0 +1,3 @@
|
||||
json.array! @messages do |message|
|
||||
json.partial! 'public/api/v1/models/message.json.jbuilder', resource: message
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! 'public/api/v1/models/message.json.jbuilder', resource: @message
|
||||
4
app/views/public/api/v1/models/_contact.json.jbuilder
Normal file
4
app/views/public/api/v1/models/_contact.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.id resource.id
|
||||
json.name resource.name
|
||||
json.email resource.email
|
||||
json.pubsub_token resource.pubsub_token
|
||||
10
app/views/public/api/v1/models/_conversation.json.jbuilder
Normal file
10
app/views/public/api/v1/models/_conversation.json.jbuilder
Normal file
@@ -0,0 +1,10 @@
|
||||
json.id resource.display_id
|
||||
json.inbox_id resource.inbox_id
|
||||
json.contact_last_seen_at resource.contact_last_seen_at.to_i
|
||||
json.status resource.status
|
||||
json.messages do
|
||||
json.array! resource.messages do |message|
|
||||
json.partial! 'public/api/v1/models/message.json.jbuilder', resource: message
|
||||
end
|
||||
end
|
||||
json.contact resource.contact
|
||||
9
app/views/public/api/v1/models/_message.json.jbuilder
Normal file
9
app/views/public/api/v1/models/_message.json.jbuilder
Normal file
@@ -0,0 +1,9 @@
|
||||
json.id resource.id
|
||||
json.content resource.content
|
||||
json.message_type resource.message_type_before_type_cast
|
||||
json.content_type resource.content_type
|
||||
json.content_attributes resource.content_attributes
|
||||
json.created_at resource.created_at.to_i
|
||||
json.conversation_id resource.conversation.display_id
|
||||
json.attachments resource.attachments.map(&:push_event_data) if resource.attachments.present?
|
||||
json.sender resource.sender.push_event_data if resource.sender
|
||||
Reference in New Issue
Block a user