From fd3426a98421907852a3b8b3e50527e2ffc60158 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Thu, 15 May 2025 13:11:10 +0700 Subject: [PATCH] update conversation payload for developer docs --- .../definitions/resource/contact_inboxes.yml | 2 +- swagger/definitions/resource/conversation.yml | 69 +++- .../extension/contact/conversation.yml | 37 +- .../definitions/resource/inbox_contact.yml | 20 ++ swagger/swagger.json | 325 +++++++++++++++--- 5 files changed, 401 insertions(+), 52 deletions(-) create mode 100644 swagger/definitions/resource/inbox_contact.yml diff --git a/swagger/definitions/resource/contact_inboxes.yml b/swagger/definitions/resource/contact_inboxes.yml index 7ccba61b1..09d4086db 100644 --- a/swagger/definitions/resource/contact_inboxes.yml +++ b/swagger/definitions/resource/contact_inboxes.yml @@ -5,4 +5,4 @@ properties: description: Contact Inbox Source Id inbox: type: object - $ref: '#/components/schemas/inbox' + $ref: '#/components/schemas/inbox_contact' diff --git a/swagger/definitions/resource/conversation.yml b/swagger/definitions/resource/conversation.yml index 0a16f0134..6936a967b 100644 --- a/swagger/definitions/resource/conversation.yml +++ b/swagger/definitions/resource/conversation.yml @@ -10,27 +10,78 @@ properties: account_id: type: number description: Account Id + uuid: + type: string + description: UUID of the conversation + additional_attributes: + type: object + description: The object containing additional attributes related to the conversation + agent_last_seen_at: + type: number + description: The last activity at of the agent + assignee_last_seen_at: + type: number + description: The last activity at of the assignee + can_reply: + type: boolean + description: Whether the conversation can be replied to + contact_last_seen_at: + type: number + description: The last activity at of the contact + custom_attributes: + type: object + description: The object to save custom attributes for conversation, accepts custom attributes key and value inbox_id: type: number description: ID of the inbox + labels: + type: array + items: + type: string + description: The labels of the conversation + muted: + type: boolean + description: Whether the conversation is muted + snoozed_until: + type: number + description: The time at which the conversation will be unmuted status: type: string enum: ['open', 'resolved', 'pending'] description: The status of the conversation + created_at: + type: number + description: The time at which conversation was created + updated_at: + type: number + description: The time at which conversation was updated timestamp: type: string description: The time at which conversation was created - contact_last_seen_at: - type: string - agent_last_seen_at: - type: string + first_reply_created_at: + type: number + description: The time at which the first reply was created unread_count: type: number description: The number of unread messages - additional_attributes: + last_non_activity_message: type: object - description: The object containing additional attributes related to the conversation - custom_attributes: + description: The last non activity message + last_activity_at: + type: number + description: The last activity at of the conversation + priority: + type: string + description: The priority of the conversation + waiting_since: + type: number + description: The time at which the conversation was waiting + sla_policy_id: + type: number + description: The ID of the SLA policy + applied_sla: type: object - description: The object to save custom attributes for conversation, accepts custom attributes key and value - example: { attribute_key: attribute_value, priority_conversation_number: 3 } + description: The applied SLA + sla_events: + type: array + diff --git a/swagger/definitions/resource/extension/contact/conversation.yml b/swagger/definitions/resource/extension/contact/conversation.yml index 19936e7e8..ef1b0eb75 100644 --- a/swagger/definitions/resource/extension/contact/conversation.yml +++ b/swagger/definitions/resource/extension/contact/conversation.yml @@ -6,17 +6,48 @@ properties: sender: type: object properties: + additional_attributes: + type: object + description: The additional attributes of the sender + availability_status: + type: string + description: The availability status of the sender + email: + type: string + description: The email of the sender id: type: number description: ID fo the sender name: type: string description: The name of the sender + phone_number: + type: string + description: The phone number of the sender + blocked: + type: boolean + description: Whether the sender is blocked + identifier: + type: string + description: The identifier of the sender thumbnail: type: string description: Avatar URL of the contact - channel: - type: string - description: Channel Type + custom_attributes: + type: object + description: The custom attributes of the sender + last_activity_at: + type: number + description: The last activity at of the sender + created_at: + type: number + description: The created at of the sender + + channel: + type: string + description: Channel Type assignee: $ref: '#/components/schemas/user' + hmac_verified: + type: boolean + description: Whether the hmac is verified diff --git a/swagger/definitions/resource/inbox_contact.yml b/swagger/definitions/resource/inbox_contact.yml new file mode 100644 index 000000000..fcac3d821 --- /dev/null +++ b/swagger/definitions/resource/inbox_contact.yml @@ -0,0 +1,20 @@ +type: object +properties: + id: + type: number + description: ID of the inbox + avatar_url: + type: string + description: The avatar image of the inbox + channel_id: + type: number + description: The ID of the channel + name: + type: string + description: The name of the inbox + channel_type: + type: string + description: The type of the inbox + provider: + type: string + description: The provider of the inbox diff --git a/swagger/swagger.json b/swagger/swagger.json index fdc8edad6..c9be582ee 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -7870,10 +7870,53 @@ "type": "number", "description": "Account Id" }, + "uuid": { + "type": "string", + "description": "UUID of the conversation" + }, + "additional_attributes": { + "type": "object", + "description": "The object containing additional attributes related to the conversation" + }, + "agent_last_seen_at": { + "type": "number", + "description": "The last activity at of the agent" + }, + "assignee_last_seen_at": { + "type": "number", + "description": "The last activity at of the assignee" + }, + "can_reply": { + "type": "boolean", + "description": "Whether the conversation can be replied to" + }, + "contact_last_seen_at": { + "type": "number", + "description": "The last activity at of the contact" + }, + "custom_attributes": { + "type": "object", + "description": "The object to save custom attributes for conversation, accepts custom attributes key and value" + }, "inbox_id": { "type": "number", "description": "ID of the inbox" }, + "labels": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The labels of the conversation" + }, + "muted": { + "type": "boolean", + "description": "Whether the conversation is muted" + }, + "snoozed_until": { + "type": "number", + "description": "The time at which the conversation will be unmuted" + }, "status": { "type": "string", "enum": [ @@ -7883,54 +7926,77 @@ ], "description": "The status of the conversation" }, + "created_at": { + "type": "number", + "description": "The time at which conversation was created" + }, + "updated_at": { + "type": "number", + "description": "The time at which conversation was updated" + }, "timestamp": { "type": "string", "description": "The time at which conversation was created" }, - "contact_last_seen_at": { - "type": "string" - }, - "agent_last_seen_at": { - "type": "string" + "first_reply_created_at": { + "type": "number", + "description": "The time at which the first reply was created" }, "unread_count": { "type": "number", "description": "The number of unread messages" }, - "additional_attributes": { + "last_non_activity_message": { "type": "object", - "description": "The object containing additional attributes related to the conversation" + "description": "The last non activity message" }, - "custom_attributes": { + "last_activity_at": { + "type": "number", + "description": "The last activity at of the conversation" + }, + "priority": { + "type": "string", + "description": "The priority of the conversation" + }, + "waiting_since": { + "type": "number", + "description": "The time at which the conversation was waiting" + }, + "sla_policy_id": { + "type": "number", + "description": "The ID of the SLA policy" + }, + "applied_sla": { "type": "object", - "description": "The object to save custom attributes for conversation, accepts custom attributes key and value", - "example": { - "attribute_key": "attribute_value", - "priority_conversation_number": 3 - } + "description": "The applied SLA" + }, + "sla_events": { + "type": "array" } } }, "message": { "type": "object", "properties": { + "id": { + "type": "number", + "description": "The ID of the message" + }, "content": { "type": "string", "description": "The text content of the message" }, - "content_type": { - "type": "string", - "enum": [ - "text", - "input_select", - "cards", - "form" - ], - "description": "The type of the template message" + "account_id": { + "type": "number", + "description": "The ID of the account" }, - "content_attributes": { - "type": "object", - "description": "The content attributes for each content_type" + "inbox_id": { + "type": "number", + "description": "The ID of the inbox" + }, + "conversation_id": { + "type": "number", + "description": "The ID of the conversation" }, "message_type": { "type": "string", @@ -7946,10 +8012,75 @@ "type": "integer", "description": "The time at which message was created" }, + "updated_at": { + "type": "integer", + "description": "The time at which message was updated" + }, "private": { "type": "boolean", "description": "The flags which shows whether the message is private or not" }, + "status": { + "type": "string", + "enum": [ + "sent", + "delivered", + "read", + "failed" + ], + "description": "The status of the message" + }, + "source_id": { + "type": "string", + "description": "The source ID of the message" + }, + "content_type": { + "type": "string", + "enum": [ + "text", + "input_select", + "cards", + "form" + ], + "description": "The type of the template message" + }, + "content_attributes": { + "type": "object", + "description": "The content attributes for each content_type" + }, + "sender_type": { + "type": "string", + "enum": [ + "contact", + "agent", + "agent_bot" + ], + "description": "The type of the sender" + }, + "sender_id": { + "type": "number", + "description": "The ID of the sender" + }, + "external_source_ids": { + "type": "object", + "description": "The external source IDs of the message" + }, + "additional_attributes": { + "type": "object", + "description": "The additional attributes of the message" + }, + "processed_message_content": { + "type": "string", + "description": "The processed message content" + }, + "sentiment": { + "type": "object", + "description": "The sentiment of the message" + }, + "conversation": { + "type": "object", + "description": "The conversation object" + }, "attachment": { "type": "object", "description": "The file object attached to the image" @@ -7957,10 +8088,6 @@ "sender": { "type": "object", "description": "User/Agent/AgentBot object" - }, - "conversation_id": { - "type": "number", - "description": "ID of the conversation" } } }, @@ -8176,7 +8303,7 @@ "description": "Contact Inbox Source Id" }, "inbox": { - "$ref": "#/components/schemas/inbox" + "$ref": "#/components/schemas/inbox_contact" } } }, @@ -9946,6 +10073,18 @@ "sender": { "type": "object", "properties": { + "additional_attributes": { + "type": "object", + "description": "The additional attributes of the sender" + }, + "availability_status": { + "type": "string", + "description": "The availability status of the sender" + }, + "email": { + "type": "string", + "description": "The email of the sender" + }, "id": { "type": "number", "description": "ID fo the sender" @@ -9954,18 +10093,46 @@ "type": "string", "description": "The name of the sender" }, + "phone_number": { + "type": "string", + "description": "The phone number of the sender" + }, + "blocked": { + "type": "boolean", + "description": "Whether the sender is blocked" + }, + "identifier": { + "type": "string", + "description": "The identifier of the sender" + }, "thumbnail": { "type": "string", "description": "Avatar URL of the contact" }, - "channel": { - "type": "string", - "description": "Channel Type" + "custom_attributes": { + "type": "object", + "description": "The custom attributes of the sender" + }, + "last_activity_at": { + "type": "number", + "description": "The last activity at of the sender" + }, + "created_at": { + "type": "number", + "description": "The created at of the sender" } } }, + "channel": { + "type": "string", + "description": "Channel Type" + }, "assignee": { "$ref": "#/components/schemas/user" + }, + "hmac_verified": { + "type": "boolean", + "description": "Whether the hmac is verified" } } } @@ -10037,6 +10204,18 @@ "sender": { "type": "object", "properties": { + "additional_attributes": { + "type": "object", + "description": "The additional attributes of the sender" + }, + "availability_status": { + "type": "string", + "description": "The availability status of the sender" + }, + "email": { + "type": "string", + "description": "The email of the sender" + }, "id": { "type": "number", "description": "ID fo the sender" @@ -10045,18 +10224,46 @@ "type": "string", "description": "The name of the sender" }, + "phone_number": { + "type": "string", + "description": "The phone number of the sender" + }, + "blocked": { + "type": "boolean", + "description": "Whether the sender is blocked" + }, + "identifier": { + "type": "string", + "description": "The identifier of the sender" + }, "thumbnail": { "type": "string", "description": "Avatar URL of the contact" }, - "channel": { - "type": "string", - "description": "Channel Type" + "custom_attributes": { + "type": "object", + "description": "The custom attributes of the sender" + }, + "last_activity_at": { + "type": "number", + "description": "The last activity at of the sender" + }, + "created_at": { + "type": "number", + "description": "The created at of the sender" } } }, + "channel": { + "type": "string", + "description": "Channel Type" + }, "assignee": { "$ref": "#/components/schemas/user" + }, + "hmac_verified": { + "type": "boolean", + "description": "Whether the hmac is verified" } } } @@ -10084,6 +10291,18 @@ "sender": { "type": "object", "properties": { + "additional_attributes": { + "type": "object", + "description": "The additional attributes of the sender" + }, + "availability_status": { + "type": "string", + "description": "The availability status of the sender" + }, + "email": { + "type": "string", + "description": "The email of the sender" + }, "id": { "type": "number", "description": "ID fo the sender" @@ -10092,18 +10311,46 @@ "type": "string", "description": "The name of the sender" }, + "phone_number": { + "type": "string", + "description": "The phone number of the sender" + }, + "blocked": { + "type": "boolean", + "description": "Whether the sender is blocked" + }, + "identifier": { + "type": "string", + "description": "The identifier of the sender" + }, "thumbnail": { "type": "string", "description": "Avatar URL of the contact" }, - "channel": { - "type": "string", - "description": "Channel Type" + "custom_attributes": { + "type": "object", + "description": "The custom attributes of the sender" + }, + "last_activity_at": { + "type": "number", + "description": "The last activity at of the sender" + }, + "created_at": { + "type": "number", + "description": "The created at of the sender" } } }, + "channel": { + "type": "string", + "description": "Channel Type" + }, "assignee": { "$ref": "#/components/schemas/user" + }, + "hmac_verified": { + "type": "boolean", + "description": "Whether the hmac is verified" } } }