chore: Add Message API, cleanup conversation_id param (#2249)
This commit is contained in:
25
swagger/paths/conversation/messages/create.yml
Normal file
25
swagger/paths/conversation/messages/create.yml
Normal 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
|
||||
12
swagger/paths/conversation/messages/delete.yml
Normal file
12
swagger/paths/conversation/messages/delete.yml
Normal 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
|
||||
18
swagger/paths/conversation/messages/index.yml
Normal file
18
swagger/paths/conversation/messages/index.yml
Normal 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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user