chore: Add Message API, cleanup conversation_id param (#2249)

This commit is contained in:
Pranav Raj S
2021-05-11 20:20:52 +05:30
committed by GitHub
parent b5ef9f14e1
commit c1a519db43
19 changed files with 361 additions and 297 deletions

View File

@@ -0,0 +1,25 @@
tags:
- Messages
operationId: create-a-new-message-in-a-conversation
summary: Create New Message
description: Create a new message in the conversation
security:
- userApiKey: []
- agentBotApiKey: []
parameters:
- 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

@@ -0,0 +1,12 @@
tags:
- Messages
operationId: delete-a-message
summary: Delete a message
description: Delete a message and it's attachments from the conversation.
responses:
200:
description: Success
401:
description: Unauthorized
404:
description: The message or conversation does not exist in the account

View File

@@ -0,0 +1,18 @@
tags:
- Messages
operationId: list-all-messages
summary: Get messages
description: List all messages of a conversation
responses:
200:
description: Success
type: array
description: Array of messages
schema:
allOf:
- $ref: '#/definitions/generic_id'
- $ref: '#/definitions/message'
404:
description: Conversation not found
401:
description: Unauthorized

View File

@@ -1,57 +0,0 @@
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
security:
- userApiKey: []
- agentBotApiKey: []
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