Chore: Update Swagger API docs (#608)

This commit is contained in:
Pranav Raj S
2020-03-11 16:19:13 +05:30
committed by GitHub
parent a5b1e2b650
commit 260e40831a
23 changed files with 1014 additions and 463 deletions

View File

@@ -1,6 +1,6 @@
post:
tags:
- Conversation
- ConversationAssignment
operationId: conversationAssignment
summary: Assign Conversation
description: Assign a conversation to an agent
@@ -19,7 +19,7 @@ post:
assignee_id:
type: number
responses:
204:
200:
description: Success
schema:
$ref: '#/definitions/user'

View File

@@ -1,6 +1,6 @@
get:
tags:
- Conversation
- ConversationLabels
operationId: conversationLabelsList
summary: List Labels
description: Lists all the labels of a conversation
@@ -8,7 +8,7 @@ get:
- name: id
in: path
type: number
description: id of the conversation
description: ID of the conversation
required: true
responses:
200:
@@ -22,7 +22,7 @@ get:
post:
tags:
- Conversation
- ConversationLabels
operationId: conversationAddLabels
summary: Add Labels
description: Creates new labels and associates it with the conversation
@@ -30,7 +30,7 @@ post:
- name: id
in: path
type: number
description: id of the conversation
description: ID of the conversation
required: true
- name: data
in: body
@@ -40,11 +40,11 @@ post:
properties:
labels:
type: array
description: 'array of labels'
description: 'Array of labels'
properties:
type: string
responses:
204:
200:
description: Success
schema:
$ref: '#/definitions/conversation_labels'

View File

@@ -5,9 +5,29 @@ get:
description: List all the conversations with pagination
summary: Conversations List
parameters:
- name: query_hash
- name: assignee_type
in: query
type: string
enum: ['me', 'unassigned', 'all']
required: true
- name: status
in: query
type: string
enum: ['open', 'resolved', 'bot']
required: true
- name: page
in: query
type: integer
required: true
- name: inbox_id
in: query
type: integer
- name: labels
in: query
type: array
items:
type: string
responses:
200:
description: Success

View File

@@ -1,28 +0,0 @@
post:
tags:
- Conversation
operationId: conversationNewMessage
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

View File

@@ -0,0 +1,54 @@
get:
tags:
- Messages
operationId: listAllMessages
summary: Get messages
description: List all messages of a conversation
parameters:
- name: id
in: path
type: number
description: ID of the conversation
required: true
responses:
200:
description: Success
type: array
description: Array of messages
schema:
allOf:
- $ref: '#/definitions/generic_id'
- $ref: '#/definitions/message'
404:
description: Conversation not found
403:
description: Access denied
post:
tags:
- Messages
operationId: conversationNewMessage
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:
200:
description: Success
schema:
allOf:
- $ref: '#/definitions/generic_id'
- $ref: '#/definitions/message'
404:
description: Conversation not found
403:
description: Access denied

View File

@@ -8,10 +8,21 @@ post:
- name: id
in: path
type: number
description: id of the conversation
description: ID of the conversation
required: true
- name: data
in: body
required: true
schema:
type: object
properties:
status:
type: string
enum: ["open", "resolved"]
required: true
description: The status of the conversation
responses:
204:
200:
description: Success
schema:
$ref: '#/definitions/conversation_status_toggle'