Chore: Document Conversation APIs in swagger (#552)
* Added the documentation for the conversation APIs - 8 endpoints * Added descriptions for the existing endpoints * Added new resource models and updated some parts of the contact API
This commit is contained in:
27
swagger/paths/conversation/assignments.yml
Normal file
27
swagger/paths/conversation/assignments.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
post:
|
||||
tags: [Conversation]
|
||||
summary: Assign Conversation
|
||||
description: Assign a conversation to an agent
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
type: number
|
||||
description: id of the conversation
|
||||
required: true
|
||||
- name: data
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
assignee_id:
|
||||
type: number
|
||||
responses:
|
||||
204:
|
||||
description: Success
|
||||
schema:
|
||||
$ref: '#/definitions/user'
|
||||
404:
|
||||
description: Conversation not found
|
||||
403:
|
||||
description: Access denied
|
||||
19
swagger/paths/conversation/crud.yml
Normal file
19
swagger/paths/conversation/crud.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
get:
|
||||
tags: [Conversation]
|
||||
summary: Conversation Details
|
||||
description: Get all details regarding a conversation with all messages in the conversation
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
type: number
|
||||
description: ID of Conversation
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
schema:
|
||||
$ref: '#/definitions/conversation_show'
|
||||
404:
|
||||
description: Conversation not found
|
||||
403:
|
||||
description: Access denied
|
||||
50
swagger/paths/conversation/labels.yml
Normal file
50
swagger/paths/conversation/labels.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
get:
|
||||
tags: [Conversation]
|
||||
summary: List Labels
|
||||
description: Lists all the labels of a conversation
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
type: number
|
||||
description: id of the conversation
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
schema:
|
||||
$ref: '#/definitions/conversation_labels'
|
||||
404:
|
||||
description: Conversation not found
|
||||
403:
|
||||
description: Access denied
|
||||
|
||||
post:
|
||||
tags: [Conversation]
|
||||
summary: Add Label
|
||||
description: Creates a new label and associates it with the conversation
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
type: number
|
||||
description: id of the conversation
|
||||
required: true
|
||||
- name: data
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
labels:
|
||||
type: array
|
||||
description: 'array of labels'
|
||||
properties:
|
||||
type: string
|
||||
responses:
|
||||
204:
|
||||
description: Success
|
||||
schema:
|
||||
$ref: '#/definitions/conversation_labels'
|
||||
404:
|
||||
description: Conversation not found
|
||||
403:
|
||||
description: Access denied
|
||||
17
swagger/paths/conversation/list.yml
Normal file
17
swagger/paths/conversation/list.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
get:
|
||||
tags: [Conversation]
|
||||
description: List all the conversations with pagination
|
||||
summary: Conversations List
|
||||
parameters:
|
||||
- name: query_hash
|
||||
in: query
|
||||
type: string
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
schema:
|
||||
$ref: '#/definitions/conversation_list'
|
||||
400:
|
||||
description: Bad Request Error
|
||||
schema:
|
||||
$ref: '#/definitions/bad_request_error'
|
||||
26
swagger/paths/conversation/messages.yml
Normal file
26
swagger/paths/conversation/messages.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
post:
|
||||
tags: [Conversation]
|
||||
summary: Create New Message
|
||||
description: All the agent replies are created as new messages through this endpoint
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
type: number
|
||||
description: id of the conversation
|
||||
required: true
|
||||
- name: data
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/conversation_message_create'
|
||||
responses:
|
||||
204:
|
||||
description: Success
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/generic_id'
|
||||
- $ref: '#/definitions/message'
|
||||
404:
|
||||
description: Conversation not found
|
||||
403:
|
||||
description: Access denied
|
||||
19
swagger/paths/conversation/toggle_status.yml
Normal file
19
swagger/paths/conversation/toggle_status.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
post:
|
||||
tags: [Conversation]
|
||||
summary: Toggle Status
|
||||
description: Toggles the status of the conversation between open and resolved
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
type: number
|
||||
description: id of the conversation
|
||||
required: true
|
||||
responses:
|
||||
204:
|
||||
description: Success
|
||||
schema:
|
||||
$ref: '#/definitions/conversation_status_toggle'
|
||||
404:
|
||||
description: Conversation not found
|
||||
403:
|
||||
description: Access denied
|
||||
17
swagger/paths/conversation/update_last_seen.yml
Normal file
17
swagger/paths/conversation/update_last_seen.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
post:
|
||||
tags: [Conversation]
|
||||
summary: Update Last Seen
|
||||
description: Updates the last seen of the conversation so that conversations will have the bubbles in the agents screen
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
type: number
|
||||
description: id of the conversation
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
404:
|
||||
description: Contact not found
|
||||
403:
|
||||
description: Access denied
|
||||
Reference in New Issue
Block a user