feat: Update swagger to openapi 3.0.4, update request payloads with examples (#11374)

This commit is contained in:
Daniel Jimenez
2025-05-22 19:26:44 +12:00
committed by GitHub
parent 8697a30dc5
commit 4b417ce9e7
189 changed files with 10098 additions and 5847 deletions

View File

@@ -4,48 +4,32 @@ post:
operationId: inboxCreation
summary: Create an inbox
description: You can create more than one website inbox in each account
security:
- userApiKey: []
parameters:
- $ref: '#/parameters/account_id'
- name: data
in: body
required: true
schema:
type: object
properties:
name:
type: string
description: The name of the inbox
avatar:
type: string
format: binary
description: File for avatar image
channel:
type: object
properties:
type:
type: string
enum: ['web_widget']
website_url:
type: string
description: URL at which the widget will be loaded
welcome_title:
type: string
description: Welcome title to be displayed on the widget
welcome_tagline:
type: string
description: Welcome tagline to be displayed on the widget
agent_away_message:
type: string
description: A message which will be sent if there is not agent available. This is not available if agentbot is connected
widget_color:
type: string
description: A Hex-color string used to customize the widget
- $ref: '#/components/parameters/account_id'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/inbox_create_payload'
responses:
200:
'200':
description: Success
schema:
$ref: '#/definitions/inbox'
404:
content:
application/json:
schema:
$ref: '#/components/schemas/inbox'
'404':
description: Inbox not found
403:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'403':
description: Access denied
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -4,19 +4,32 @@ get:
operationId: getInboxAgentBot
summary: Show Inbox Agent Bot
description: See if an agent bot is associated to the Inbox
security:
- userApiKey: []
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/components/parameters/account_id'
- name: id
in: path
type: number
schema:
type: number
description: ID of the inbox
required: true
responses:
204:
'204':
description: Success
schema:
$ref: '#/definitions/agent_bot'
404:
content:
application/json:
schema:
$ref: '#/components/schemas/agent_bot'
'404':
description: Inbox not found, Agent bot not found
403:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'403':
description: Access denied
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -5,35 +5,51 @@ summary: Add a New Agent
description: Add a new Agent to Inbox
security:
- userApiKey: []
parameters:
- name: data
in: body
required: true
schema:
type: object
required:
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- inbox_id
- user_ids
properties:
inbox_id:
type: string
description: The ID of the inbox
user_ids:
type: array
items:
properties:
inbox_id:
type: integer
description: IDs of users to be added to the inbox
description: The ID of the inbox
example: 1
user_ids:
type: array
items:
type: integer
description: IDs of users to be added to the inbox
example: [1]
responses:
200:
'200':
description: Success
schema:
type: array
description: 'Array of all active agents'
items:
$ref: '#/definitions/agent'
404:
content:
application/json:
schema:
type: array
description: 'Array of all active agents'
items:
$ref: '#/components/schemas/agent'
'404':
description: Inbox not found
403:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'403':
description: Access denied
422:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'422':
description: User must exist
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -5,30 +5,42 @@ summary: Remove an Agent from Inbox
description: Remove an Agent from Inbox
security:
- userApiKey: []
parameters:
- name: data
in: body
required: true
schema:
type: object
required:
- inbox_id
- user_ids
properties:
inbox_id:
type: string
description: The ID of the inbox
user_ids:
type: array
items:
type: integer
description: IDs of users to be deleted from the inbox
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- inbox_id
- user_ids
properties:
inbox_id:
type: string
description: The ID of the inbox
user_ids:
type: array
items:
type: integer
description: IDs of users to be deleted from the inbox
responses:
200:
'200':
description: Success
404:
'404':
description: Inbox not found
403:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'403':
description: Access denied
422:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'422':
description: User must exist
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -6,16 +6,26 @@ description: Get Details of Agents in an Inbox
security:
- userApiKey: []
parameters:
- $ref: '#/parameters/inbox_id'
- $ref: '#/components/parameters/inbox_id'
responses:
200:
'200':
description: Success
schema:
type: array
description: 'Array of all active agents'
items:
$ref: '#/definitions/agent'
404:
content:
application/json:
schema:
type: array
description: 'Array of all active agents'
items:
$ref: '#/components/schemas/agent'
'404':
description: Inbox not found
403:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'403':
description: Access denied
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -5,35 +5,51 @@ summary: Update Agents in Inbox
description: All agents except the one passed in params will be removed
security:
- userApiKey: []
parameters:
- name: data
in: body
required: true
schema:
type: object
required:
- inbox_id
- user_ids
properties:
inbox_id:
type: string
description: The ID of the inbox
user_ids:
type: array
items:
type: integer
description: IDs of users to be added to the inbox
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- inbox_id
- user_ids
properties:
inbox_id:
type: string
description: The ID of the inbox
example: 1
user_ids:
type: array
items:
type: integer
description: IDs of users to be added to the inbox
example: [1]
responses:
200:
'200':
description: Success
schema:
type: array
description: 'Array of all active agents'
items:
$ref: '#/definitions/agent'
404:
content:
application/json:
schema:
type: array
description: 'Array of all active agents'
items:
$ref: '#/components/schemas/agent'
'404':
description: Inbox not found
403:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'403':
description: Access denied
422:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'422':
description: User must exist
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -4,17 +4,29 @@ get:
operationId: listAllInboxes
summary: List all inboxes
description: List all inboxes available in the current account
security:
- userApiKey: []
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/components/parameters/account_id'
responses:
200:
'200':
description: Success
schema:
type: array
description: 'Array of inboxes'
items:
$ref: '#/definitions/inbox'
404:
content:
application/json:
schema:
type: array
description: 'Array of inboxes'
items:
$ref: '#/components/schemas/inbox'
'404':
description: Inbox not found
403:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'403':
description: Access denied
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -3,29 +3,42 @@ post:
- Inboxes
operationId: updateAgentBot
summary: Add or remove agent bot
security:
- userApiKey: []
description: To add an agent bot pass agent_bot id, to remove agent bot from an inbox pass null
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/components/parameters/account_id'
- name: id
in: path
type: number
schema:
type: number
description: ID of the inbox
required: true
- name: data
in: body
required: true
schema:
type: object
required:
- agent_bot
properties:
agent_bot:
type: number
description: 'Agent bot ID'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- agent_bot
properties:
agent_bot:
type: number
description: 'Agent bot ID'
example: 1
responses:
204:
'204':
description: Success
404:
'404':
description: Inbox not found, Agent bot not found
403:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'403':
description: Access denied
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -3,20 +3,33 @@ get:
- Inboxes
operationId: GetInbox
summary: Get an inbox
security:
- userApiKey: []
description: Get an inbox available in the current account
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/components/parameters/account_id'
- name: id
in: path
type: number
schema:
type: number
description: ID of the inbox
required: true
responses:
200:
'200':
description: Success
schema:
$ref: '#/definitions/inbox'
404:
content:
application/json:
schema:
$ref: '#/components/schemas/inbox'
'404':
description: Inbox not found
403:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'403':
description: Access denied
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -3,58 +3,41 @@ patch:
- Inboxes
operationId: updateInbox
summary: Update Inbox
description: Add avatar and disable auto assignment for an inbox
security:
- userApiKey: []
description: Update an existing inbox
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/components/parameters/account_id'
- name: id
in: path
type: number
schema:
type: number
description: ID of the inbox
required: true
- name: data
in: body
required: true
schema:
type: object
required:
- enable_auto_assignment
properties:
name:
type: string
description: The name of the inbox
enable_auto_assignment:
type: boolean
description: 'Enable Auto Assignment'
avatar:
type: string
format: binary
description: 'Image file for avatar'
channel:
type: object
properties:
website_url:
type: string
description: URL at which the widget will be loaded
welcome_title:
type: string
description: Welcome title to be displayed on the widget
welcome_tagline:
type: string
description: Welcome tagline to be displayed on the widget
agent_away_message:
type: string
description: A message which will be sent if there is not agent available. This is not available if agentbot is connected
widget_color:
type: string
description: A Hex-color string used to customize the widget
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/inbox_update_payload'
responses:
200:
'200':
description: Success
schema:
type: object
description: 'Updated inbox object'
$ref: '#/definitions/inbox'
404:
content:
application/json:
schema:
type: object
description: 'Updated inbox object'
$ref: '#/components/schemas/inbox'
'404':
description: Inbox not found
403:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'403':
description: Access denied
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'