chore: Add documentation for APIs (#2248)
This commit is contained in:
@@ -15,6 +15,8 @@ post:
|
||||
type: number
|
||||
description: The id of the inbox
|
||||
required: true
|
||||
source_id:
|
||||
$ref: '#/parameters/source_id'
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
|
||||
17
swagger/paths/contactable_inboxes/get.yml
Normal file
17
swagger/paths/contactable_inboxes/get.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
get:
|
||||
tags:
|
||||
- Contact
|
||||
operationId: contactableInboxesGet
|
||||
description: Get List of contactable Inboxes
|
||||
summary: Get Contactable Inboxes
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
schema:
|
||||
$ref: '#/definitions/contactable_inboxes'
|
||||
401:
|
||||
description: Authentication error
|
||||
schema:
|
||||
$ref: '#/definitions/bad_request_error'
|
||||
422:
|
||||
description: Incorrect payload
|
||||
@@ -88,7 +88,7 @@ post:
|
||||
- Conversation
|
||||
operationId: newConversation
|
||||
summary: Create New Conversation
|
||||
description: Create conversation
|
||||
description: "Creating a conversation in chatwoot requires a source id. \n\n Learn more about source_id: https://github.com/chatwoot/chatwoot/wiki/Building-on-Top-of-Chatwoot:-Importing-Existing-Contacts-and-Creating-Conversations"
|
||||
security:
|
||||
- userApiKey: []
|
||||
- agentBotApiKey: []
|
||||
@@ -100,9 +100,14 @@ post:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
source_id:
|
||||
source_id:
|
||||
$ref: '#/parameters/source_id'
|
||||
inbox_id:
|
||||
type: string
|
||||
description: Contact Source Id
|
||||
description: "Id of inbox in which the conversation is created <br/> Allowed Inbox Types: Website, Phone, Api, Email "
|
||||
contact_id:
|
||||
type: string
|
||||
description: Contact Id for which conversation is created
|
||||
additional_attributes:
|
||||
type: object
|
||||
description: Lets you specify attributes like browser information
|
||||
|
||||
47
swagger/paths/conversation/messages/create_attachment.yml
Normal file
47
swagger/paths/conversation/messages/create_attachment.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
post:
|
||||
tags:
|
||||
- Messages
|
||||
operationId: conversationNewMessageAttachment
|
||||
summary: Create New Message Attachment
|
||||
description: Create an attachment Message
|
||||
consumes:
|
||||
- multipart/form-data
|
||||
security:
|
||||
- userApiKey: []
|
||||
- agentBotApiKey: []
|
||||
parameters:
|
||||
- $ref: '#/parameters/account_id'
|
||||
- $ref: '#/parameters/conversation_id'
|
||||
required: true
|
||||
- in: formData
|
||||
name: content
|
||||
type: string
|
||||
description: The content of the message
|
||||
required: true
|
||||
- in: formData
|
||||
name: message_type
|
||||
type: string
|
||||
enum: ['outgoing', 'incoming']
|
||||
- in: formData
|
||||
name: private
|
||||
type: boolean
|
||||
description: Flag to identify if it is a private note
|
||||
- in: formData
|
||||
name: attachments
|
||||
type: array
|
||||
description: The files to be uploaded.
|
||||
items:
|
||||
type: file
|
||||
|
||||
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/generic_id'
|
||||
- $ref: '#/definitions/message'
|
||||
404:
|
||||
description: Conversation not found
|
||||
403:
|
||||
description: Access denied
|
||||
@@ -4,7 +4,7 @@
|
||||
# Inboxes
|
||||
/accounts/{account_id}/inboxes:
|
||||
$ref: ./inboxes/index.yml
|
||||
/accounts/{account_id}/inboxes:
|
||||
/accounts/{account_id}/inboxes/:
|
||||
$ref: ./inboxes/create.yml
|
||||
/accounts/{account_id}/inboxes/{id}:
|
||||
$ref: ./inboxes/update.yml
|
||||
@@ -35,6 +35,8 @@
|
||||
$ref: ./conversation/toggle_status.yml
|
||||
|
||||
# Messages
|
||||
/accounts/{account_id}/conversations/{id}/messages:
|
||||
$ref: ./conversation/messages/create_attachment.yml
|
||||
/accounts/{account_id}/conversations/{converstion_id}/messages:
|
||||
parameters:
|
||||
- $ref: '#/parameters/account_id'
|
||||
@@ -84,6 +86,8 @@
|
||||
|
||||
/accounts/{account_id}/contacts/{id}/contact_inboxes:
|
||||
$ref: ./contact_inboxes/create.yml
|
||||
/accounts/{account_id}/contacts/{id}/contactable_inboxes:
|
||||
$ref: ./contactable_inboxes/get.yml
|
||||
|
||||
|
||||
# Profile
|
||||
|
||||
Reference in New Issue
Block a user