chore: Swagger documentation for public APIs (#2417)
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
# ERROR
|
||||
## ---------- ERRORS ------------- ##
|
||||
## -------------------------------- ##
|
||||
bad_request_error:
|
||||
$ref: ./error/bad_request.yml
|
||||
request_error:
|
||||
$ref: ./error/request.yml
|
||||
|
||||
# RESOURCE
|
||||
|
||||
|
||||
## ---------- RESOURCE ------------- ##
|
||||
## -------------------------------- ##
|
||||
|
||||
generic_id:
|
||||
$ref: ./resource/extension/generic.yml
|
||||
contact:
|
||||
@@ -30,11 +35,63 @@ platform_account:
|
||||
team:
|
||||
$ref: ./resource/team.yml
|
||||
integrations_app:
|
||||
$ref: ./resource/integrations/app.yml
|
||||
$ref: ./resource/integrations/app.yml
|
||||
integrations_hook:
|
||||
$ref: ./resource/integrations/hook.yml
|
||||
$ref: ./resource/integrations/hook.yml
|
||||
|
||||
# RESPONSE
|
||||
## public resources
|
||||
public_contact:
|
||||
$ref: ./resource/public/contact.yml
|
||||
public_conversation:
|
||||
$ref: ./resource/public/conversation.yml
|
||||
public_message:
|
||||
$ref: ./resource/public/message.yml
|
||||
|
||||
|
||||
## ---------- REQUEST------------- ##
|
||||
## -------------------------------- ##
|
||||
|
||||
account_create_update_payload:
|
||||
$ref: ./request/account/create_update_payload.yml
|
||||
|
||||
agent_bot_create_update_payload:
|
||||
$ref: ./request/agent_bot/create_update_payload.yml
|
||||
|
||||
user_create_update_payload:
|
||||
$ref: ./request/user/create_update_payload.yml
|
||||
|
||||
## contact
|
||||
contact_create:
|
||||
$ref: ./request/contact/create.yml
|
||||
contact_update:
|
||||
$ref: ./request/contact/update.yml
|
||||
|
||||
## conversation
|
||||
conversation_message_create:
|
||||
$ref: ./request/conversation/create_message.yml
|
||||
|
||||
# Team request Payload
|
||||
team_create_update_payload:
|
||||
$ref: ./request/team/create_update_payload.yml
|
||||
|
||||
integrations_hook_create_payload:
|
||||
$ref: ./request/integrations/hook_create_payload.yml
|
||||
|
||||
integrations_hook_update_payload:
|
||||
$ref: ./request/integrations/hook_update_payload.yml
|
||||
|
||||
|
||||
## public requests
|
||||
public_contact_create_update_payload:
|
||||
$ref: ./request/public/contact/create_update_payload.yml
|
||||
|
||||
public_message_create_payload:
|
||||
$ref: ./request/public/message/create_payload.yml
|
||||
public_message_update_payload:
|
||||
$ref: ./request/public/message/update_payload.yml
|
||||
|
||||
## ---------- RESPONSE ------------- ##
|
||||
## -------------------------------- ##
|
||||
|
||||
## contact
|
||||
extended_contact:
|
||||
@@ -77,34 +134,3 @@ extended_message:
|
||||
- $ref: '#/definitions/generic_id'
|
||||
- $ref: '#/definitions/message'
|
||||
- $ref: ./resource/extension/message/with_source_sender.yml
|
||||
|
||||
# REQUEST
|
||||
|
||||
account_create_update_payload:
|
||||
$ref: ./request/account/create_update_payload.yml
|
||||
|
||||
agent_bot_create_update_payload:
|
||||
$ref: ./request/agent_bot/create_update_payload.yml
|
||||
|
||||
user_create_update_payload:
|
||||
$ref: ./request/account/create_update_payload.yml
|
||||
|
||||
## contact
|
||||
contact_create:
|
||||
$ref: ./request/contact/create.yml
|
||||
contact_update:
|
||||
$ref: ./request/contact/update.yml
|
||||
## conversation
|
||||
conversation_message_create:
|
||||
$ref: ./request/conversation/create_message.yml
|
||||
|
||||
# Team request Payload
|
||||
|
||||
team_create_update_payload:
|
||||
$ref: ./request/team/create_update_payload.yml
|
||||
|
||||
integrations_hook_create_payload:
|
||||
$ref: ./request/integrations/hook_create_payload.yml
|
||||
|
||||
integrations_hook_update_payload:
|
||||
$ref: ./request/integrations/hook_update_payload.yml
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
type: object
|
||||
properties:
|
||||
identifier:
|
||||
type: string
|
||||
description: External identifier of the contact
|
||||
identifier_hash:
|
||||
type: string
|
||||
description: Identifier hash prepared for HMAC authentication
|
||||
email:
|
||||
type: string
|
||||
description: Email of the contact
|
||||
name:
|
||||
type: string
|
||||
description: Name of the contact
|
||||
avatar_url:
|
||||
type: string
|
||||
description: The url to a jpeg, png file for the user avatar
|
||||
custom_attributes:
|
||||
type: object
|
||||
description: Custom attributes of the customer
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: string
|
||||
description: Content for the message
|
||||
echo_id:
|
||||
type: string
|
||||
description: Temporary identifier which will be passed back via websockets
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
type: object
|
||||
properties:
|
||||
submitted_values:
|
||||
type: object
|
||||
description: Replies to the Bot Message Types
|
||||
|
||||
|
||||
17
swagger/definitions/resource/public/contact.yml
Normal file
17
swagger/definitions/resource/public/contact.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: Id of the contact
|
||||
source_id:
|
||||
type: string
|
||||
description: The session identifier of the contact
|
||||
name:
|
||||
type: string
|
||||
description: Name of the contact
|
||||
email:
|
||||
type: string
|
||||
description: Email of the contact
|
||||
pubsub_token:
|
||||
type: string
|
||||
description: The token to be used to connect to chatwoot websocket
|
||||
14
swagger/definitions/resource/public/conversation.yml
Normal file
14
swagger/definitions/resource/public/conversation.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: Id of the conversation
|
||||
inbox_id:
|
||||
type: string
|
||||
description: The inbox id of the conversation
|
||||
messages:
|
||||
type: array
|
||||
description: Messages in the conversation
|
||||
contact:
|
||||
type: object
|
||||
description: The contact information associated to the conversation
|
||||
36
swagger/definitions/resource/public/message.yml
Normal file
36
swagger/definitions/resource/public/message.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Id of the message
|
||||
content:
|
||||
type: string
|
||||
description: Text content of the message
|
||||
message_type:
|
||||
type: string
|
||||
description: Denotes the message type
|
||||
content_type:
|
||||
type: string
|
||||
description: Content type of the message
|
||||
content_attributes:
|
||||
type: string
|
||||
description: Additional content attributes of the message
|
||||
created_at:
|
||||
type: string
|
||||
description: Created at time stamp of the message
|
||||
conversation_id:
|
||||
type: string
|
||||
description: Conversation Id of the message
|
||||
attachments:
|
||||
type: array
|
||||
description: Attachments if any
|
||||
sender:
|
||||
type: object
|
||||
description: Details of the sender
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@ properties:
|
||||
enum: ['agent', 'administrator']
|
||||
confirmed:
|
||||
type: boolean
|
||||
display_name:
|
||||
type: string
|
||||
accounts:
|
||||
type: array
|
||||
items:
|
||||
|
||||
Reference in New Issue
Block a user