chore: Add Swagger Doc for Team Members (#4390)

Add swagger documentation for Team Members APIs
This commit is contained in:
Sojan Jose 2022-04-05 16:05:49 +05:30 committed by GitHub
parent 2595e774e5
commit 7a8aa4ca2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 440 additions and 94 deletions

View file

@ -1,7 +1,3 @@
if @team_member
json.partial! 'api/v1/models/agent.json.jbuilder', resource: @team_member
elsif @team_members.present?
json.array! @team_members do |team_member|
json.partial! 'api/v1/models/agent.json.jbuilder', resource: team_member
end
json.array! @team_members do |team_member|
json.partial! 'api/v1/models/agent.json.jbuilder', resource: team_member
end

View file

@ -53,18 +53,18 @@ x-tagGroups:
- name: Application
tags:
- Account AgentBots
- Agent
- Canned Response
- Contact
- Conversation
- Agents
- Canned Responses
- Contacts
- Conversations
- Conversation Assignment
- Conversation Labels
- Inbox
- Inboxes
- Messages
- Integrations
- Profile
- Teams
- Custom Filter
- Custom Filters
- Reports
- name: Client
tags:

View file

@ -1,5 +1,5 @@
in: path
name: id
name: team_id
type: integer
required: true
description: The ID of the team to be updated

View file

@ -1,5 +1,5 @@
tags:
- Agent
- Agents
operationId: add-new-agent-to-account
summary: Add a New Agent
description: Add a new Agent to Account

View file

@ -1,5 +1,5 @@
tags:
- Agent
- Agents
operationId: delete-agent-from-account
summary: Remove an Agent from Account
description: Remove an Agent from Account

View file

@ -1,5 +1,5 @@
tags:
- Agent
- Agents
operationId: get-account-agents
summary: List Agents in Account
description: Get Details of Agents in an Account

View file

@ -1,5 +1,5 @@
tags:
- Agent
- Agents
operationId: update-agent-in-account
summary: Update Agent in Account
description: Update an Agent in Account

View file

@ -1,5 +1,5 @@
tags:
- Canned Response
- Canned Responses
operationId: add-new-canned-response-to-account
summary: Add a New Canned Response
description: Add a new Canned Response to Account

View file

@ -1,5 +1,5 @@
tags:
- Canned Response
- Canned Responses
operationId: delete-canned-response-from-account
summary: Remove a Canned Response from Account
description: Remove a Canned Response from Account

View file

@ -1,5 +1,5 @@
tags:
- Canned Response
- Canned Responses
operationId: get-account-canned-response
summary: List all Canned Responses in an Account
description: Get Details of Canned Responses in an Account

View file

@ -1,6 +1,6 @@
get:
tags:
- Contact
- Contacts
operationId: contactConversations
summary: Contact Conversations
description: Get conversations associated to that contact

View file

@ -8,7 +8,7 @@ parameters:
get:
tags:
- Contact
- Contacts
operationId: contactDetails
summary: Show Contact
description: Get a contact belonging to the account using ID
@ -24,7 +24,7 @@ get:
put:
tags:
- Contact
- Contacts
operationId: contactUpdate
summary: Update Contact
description: Update a contact belonging to the account using ID
@ -46,7 +46,7 @@ put:
delete:
tags:
- Contact
- Contacts
operationId: contactDelete
summary: Delete Contact
responses:

View file

@ -1,5 +1,5 @@
tags:
- Contact
- Contacts
operationId: contactFilter
description: Filter contacts with custom filter options and pagination
summary: Contact Filter

View file

@ -1,6 +1,6 @@
get:
tags:
- Contact
- Contacts
operationId: contactList
description: Listing all the resolved contacts with pagination (Page size = 15) . Resolved contacts are the ones with a value for identifier, email or phone number
summary: List Contacts
@ -20,7 +20,7 @@ get:
post:
tags:
- Contact
- Contacts
operationId: contactCreate
description: Create a new Contact
summary: Create Contact

View file

@ -1,6 +1,6 @@
get:
tags:
- Contact
- Contacts
operationId: contactSearch
description: Search the resolved contacts using a search key, currently supports email search (Page size = 15). Resolved contacts are the ones with a value for identifier, email or phone number
summary: Search Contacts

View file

@ -1,5 +1,5 @@
tags:
- Conversation
- Conversations
operationId: conversationFilter
description: Filter conversations with custom filter options and pagination
summary: Conversations Filter

View file

@ -3,7 +3,7 @@ parameters:
get:
tags:
- Conversation
- Conversations
operationId: conversationList
description: List all the conversations with pagination
summary: Conversations List
@ -43,7 +43,7 @@ get:
post:
tags:
- Conversation
- Conversations
operationId: newConversation
summary: Create New 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"

View file

@ -1,5 +1,5 @@
tags:
- Conversation
- Conversations
operationId: get-details-of-a-conversation
summary: Conversation Details
description: Get all details regarding a conversation with all messages in the conversation

View file

@ -1,5 +1,5 @@
tags:
- Conversation
- Conversations
operationId: toggle-status-of-a-conversation
summary: Toggle Status
description: Toggles the status of the conversation between open and resolved

View file

@ -1,6 +1,6 @@
post:
tags:
- Conversation
- Conversations
operationId: conversationUpdateLastSeen
summary: Update Last Seen
description: Updates the last seen of the conversation so that conversations will have the bubbles in the agents screen

View file

@ -1,5 +1,5 @@
tags:
- Custom Filter
- Custom Filters
operationId: create-a-custom-filter
summary: Create a custom filter
description: Create a custom filter in the account

View file

@ -1,5 +1,5 @@
tags:
- Custom Filter
- Custom Filters
operationId: delete-a-custom-filter
summary: Delete a custom filter
description: Delete a custom filter from the account

View file

@ -1,5 +1,5 @@
tags:
- Custom Filter
- Custom Filters
operationId: list-all-filters
summary: List all custom filters
description: List all custom filters in a category of a user

View file

@ -1,5 +1,5 @@
tags:
- Custom Filter
- Custom Filters
operationId: get-details-of-a-single-custom-filter
summary: Get a custom filter details
description: Get the details of a custom filter in the account

View file

@ -1,5 +1,5 @@
tags:
- Custom Filter
- Custom Filters
operationId: update-a-custom-filter
summary: Update a custom filter
description: Update a custom filter's attributes

View file

@ -1,6 +1,6 @@
post:
tags:
- Inbox
- Inboxes
operationId: inboxCreation
summary: Create an inbox
description: You can create more than one website inbox in each account

View file

@ -1,6 +1,6 @@
get:
tags:
- Inbox
- Inboxes
operationId: getInboxAgentBot
summary: Show Inbox Agent Bot
description: See if an agent bot is associated to the Inbox

View file

@ -1,5 +1,5 @@
tags:
- Inbox
- Inboxes
operationId: add-new-agent-to-inbox
summary: Add a New Agent
description: Add a new Agent to Inbox

View file

@ -1,5 +1,5 @@
tags:
- Inbox
- Inboxes
operationId: delete-agent-in-inbox
summary: Remove an Agent from Inbox
description: Remove an Agent from Inbox

View file

@ -1,5 +1,5 @@
tags:
- Inbox
- Inboxes
operationId: get-inbox-members
summary: List Agents in Inbox
description: Get Details of Agents in an Inbox

View file

@ -1,5 +1,5 @@
tags:
- Inbox
- Inboxes
operationId: update-agents-in-inbox
summary: Update Agents in Inbox
description: All agents except the one passed in params will be removed

View file

@ -1,6 +1,6 @@
get:
tags:
- Inbox
- Inboxes
operationId: listAllInboxes
summary: List all inboxes
description: List all inboxes available in the current account

View file

@ -1,6 +1,6 @@
post:
tags:
- Inbox
- Inboxes
operationId: updateAgentBot
summary: Add or remove agent bot
description: To add an agent bot pass agent_bot id, to remove agent bot from an inbox pass null

View file

@ -1,6 +1,6 @@
get:
tags:
- Inbox
- Inboxes
operationId: GetInbox
summary: Get an inbox
description: Get an inbox available in the current account

View file

@ -1,6 +1,6 @@
patch:
tags:
- Inbox
- Inboxes
operationId: updateInbox
summary: Update Inbox
description: Add avatar and disable auto assignment for an inbox

View file

@ -0,0 +1,35 @@
tags:
- Teams
operationId: add-new-agent-to-team
summary: Add a New Agent
description: Add a new Agent to Team
security:
- userApiKey: []
parameters:
- name: data
in: body
required: true
schema:
type: object
required:
- user_ids
properties:
user_ids:
type: array
items:
type: integer
description: IDs of users to be added to the team
responses:
200:
description: Success
schema:
type: array
description: 'Array of all active agents'
items:
$ref: '#/definitions/agent'
404:
description: Team not found
403:
description: Access denied
422:
description: User must exist

View file

@ -0,0 +1,31 @@
tags:
- Teams
operationId: delete-agent-in-team
summary: Remove an Agent from Team
description: Remove an Agent from Team
security:
- userApiKey: []
parameters:
- name: data
in: body
required: true
schema:
type: object
required:
- team_id
- user_ids
properties:
user_ids:
type: array
items:
type: integer
description: IDs of users to be deleted from the team
responses:
200:
description: Success
404:
description: Team not found
403:
description: Access denied
422:
description: User must exist

View file

@ -0,0 +1,21 @@
tags:
- Teams
operationId: get-team-members
summary: List Agents in Team
description: Get Details of Agents in an Team
security:
- userApiKey: []
parameters:
- $ref: '#/parameters/team_id'
responses:
200:
description: Success
schema:
type: array
description: 'Array of all agents in the team'
items:
$ref: '#/definitions/agent'
404:
description: Inbox not found
403:
description: Access denied

View file

@ -0,0 +1,35 @@
tags:
- Teams
operationId: update-agents-in-team
summary: Update Agents in Team
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:
- user_ids
properties:
user_ids:
type: array
items:
type: integer
description: IDs of users to be added to the team
responses:
200:
description: Success
schema:
type: array
description: 'Array of all agents in the team'
items:
$ref: '#/definitions/agent'
404:
description: Team not found
403:
description: Access denied
422:
description: User must exist

View file

@ -154,7 +154,7 @@
delete:
$ref: ./application/agents/delete.yml
# Agents
# Canned Responses
/api/v1/accounts/{account_id}/canned_responses:
parameters:
- $ref: '#/parameters/account_id'
@ -315,7 +315,7 @@
$ref: ./application/teams/index.yml
post:
$ref: ./application/teams/create.yml
/api/v1/accounts/{account_id}/teams/{id}:
/api/v1/accounts/{account_id}/teams/{team_id}:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/team_id'
@ -325,6 +325,18 @@
$ref: ./application/teams/update.yml
delete:
$ref: ./application/teams/delete.yml
/accounts/{account-id}/teams/{team_id}/team_members:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/team_id'
get:
$ref: ./application/team_members/index.yml
post:
$ref: ./application/team_members/create.yml
patch:
$ref: ./application/team_members/update.yml
delete:
$ref: ./application/team_members/delete.yml
### Custom Filters goes here

View file

@ -1118,7 +1118,7 @@
],
"get": {
"tags": [
"Agent"
"Agents"
],
"operationId": "get-account-agents",
"summary": "List Agents in Account",
@ -1148,7 +1148,7 @@
},
"post": {
"tags": [
"Agent"
"Agents"
],
"operationId": "add-new-agent-to-account",
"summary": "Add a New Agent",
@ -1227,7 +1227,7 @@
],
"patch": {
"tags": [
"Agent"
"Agents"
],
"operationId": "update-agent-in-account",
"summary": "Update Agent in Account",
@ -1299,7 +1299,7 @@
},
"delete": {
"tags": [
"Agent"
"Agents"
],
"operationId": "delete-agent-from-account",
"summary": "Remove an Agent from Account",
@ -1341,7 +1341,7 @@
],
"get": {
"tags": [
"Canned Response"
"Canned Responses"
],
"operationId": "get-account-canned-response",
"summary": "List all Canned Responses in an Account",
@ -1371,7 +1371,7 @@
},
"post": {
"tags": [
"Canned Response"
"Canned Responses"
],
"operationId": "add-new-canned-response-to-account",
"summary": "Add a New Canned Response",
@ -1460,7 +1460,7 @@
},
"delete": {
"tags": [
"Canned Response"
"Canned Responses"
],
"operationId": "delete-canned-response-from-account",
"summary": "Remove a Canned Response from Account",
@ -1497,7 +1497,7 @@
"/api/v1/accounts/{account_id}/contacts": {
"get": {
"tags": [
"Contact"
"Contacts"
],
"operationId": "contactList",
"description": "Listing all the resolved contacts with pagination (Page size = 15) . Resolved contacts are the ones with a value for identifier, email or phone number",
@ -1530,7 +1530,7 @@
},
"post": {
"tags": [
"Contact"
"Contacts"
],
"operationId": "contactCreate",
"description": "Create a new Contact",
@ -1579,7 +1579,7 @@
],
"get": {
"tags": [
"Contact"
"Contacts"
],
"operationId": "contactDetails",
"summary": "Show Contact",
@ -1601,7 +1601,7 @@
},
"put": {
"tags": [
"Contact"
"Contacts"
],
"operationId": "contactUpdate",
"summary": "Update Contact",
@ -1633,7 +1633,7 @@
},
"delete": {
"tags": [
"Contact"
"Contacts"
],
"operationId": "contactDelete",
"summary": "Delete Contact",
@ -1653,7 +1653,7 @@
"/api/v1/accounts/{account_id}/contacts/{id}/conversations": {
"get": {
"tags": [
"Contact"
"Contacts"
],
"operationId": "contactConversations",
"summary": "Contact Conversations",
@ -1689,7 +1689,7 @@
"/api/v1/accounts/{account_id}/contacts/search": {
"get": {
"tags": [
"Contact"
"Contacts"
],
"operationId": "contactSearch",
"description": "Search the resolved contacts using a search key, currently supports email search (Page size = 15). Resolved contacts are the ones with a value for identifier, email or phone number",
@ -1740,7 +1740,7 @@
],
"post": {
"tags": [
"Contact"
"Contacts"
],
"operationId": "contactFilter",
"description": "Filter contacts with custom filter options and pagination",
@ -1947,7 +1947,7 @@
],
"get": {
"tags": [
"Conversation"
"Conversations"
],
"operationId": "conversationList",
"description": "List all the conversations with pagination",
@ -2013,7 +2013,7 @@
},
"post": {
"tags": [
"Conversation"
"Conversations"
],
"operationId": "newConversation",
"summary": "Create New Conversation",
@ -2110,7 +2110,7 @@
],
"post": {
"tags": [
"Conversation"
"Conversations"
],
"operationId": "conversationFilter",
"description": "Filter conversations with custom filter options and pagination",
@ -2221,7 +2221,7 @@
],
"get": {
"tags": [
"Conversation"
"Conversations"
],
"operationId": "get-details-of-a-conversation",
"summary": "Conversation Details",
@ -2253,7 +2253,7 @@
],
"post": {
"tags": [
"Conversation"
"Conversations"
],
"operationId": "toggle-status-of-a-conversation",
"summary": "Toggle Status",
@ -2438,7 +2438,7 @@
"/api/v1/accounts/{account_id}/inboxes": {
"get": {
"tags": [
"Inbox"
"Inboxes"
],
"operationId": "listAllInboxes",
"summary": "List all inboxes",
@ -2471,7 +2471,7 @@
"/api/v1/accounts/{account_id}/inboxes/{id}/": {
"get": {
"tags": [
"Inbox"
"Inboxes"
],
"operationId": "GetInbox",
"summary": "Get an inbox",
@ -2507,7 +2507,7 @@
"/api/v1/accounts/{account_id}/inboxes/": {
"post": {
"tags": [
"Inbox"
"Inboxes"
],
"operationId": "inboxCreation",
"summary": "Create an inbox",
@ -2586,7 +2586,7 @@
"/api/v1/accounts/{account_id}/inboxes/{id}": {
"patch": {
"tags": [
"Inbox"
"Inboxes"
],
"operationId": "updateInbox",
"summary": "Update Inbox",
@ -2673,7 +2673,7 @@
"/api/v1/accounts/{account_id}/inboxes/{id}/agent_bot": {
"get": {
"tags": [
"Inbox"
"Inboxes"
],
"operationId": "getInboxAgentBot",
"summary": "Show Inbox Agent Bot",
@ -2709,7 +2709,7 @@
"/api/v1/accounts/{account_id}/inboxes/{id}/set_agent_bot": {
"post": {
"tags": [
"Inbox"
"Inboxes"
],
"operationId": "updateAgentBot",
"summary": "Add or remove agent bot",
@ -2767,7 +2767,7 @@
],
"get": {
"tags": [
"Inbox"
"Inboxes"
],
"operationId": "get-inbox-members",
"summary": "List Agents in Inbox",
@ -2805,7 +2805,7 @@
},
"patch": {
"tags": [
"Inbox"
"Inboxes"
],
"operationId": "update-agents-in-inbox",
"summary": "Update Agents in Inbox",
@ -2868,7 +2868,7 @@
},
"delete": {
"tags": [
"Inbox"
"Inboxes"
],
"operationId": "delete-agent-in-inbox",
"summary": "Remove an Agent from Inbox",
@ -2931,7 +2931,7 @@
],
"post": {
"tags": [
"Inbox"
"Inboxes"
],
"operationId": "add-new-agent-to-inbox",
"summary": "Add a New Agent",
@ -3333,7 +3333,7 @@
}
}
},
"/api/v1/accounts/{account_id}/teams/{id}": {
"/api/v1/accounts/{account_id}/teams/{team_id}": {
"parameters": [
{
"$ref": "#/parameters/account_id"
@ -3413,6 +3413,222 @@
}
}
},
"/accounts/{account-id}/teams/{team_id}/team_members": {
"parameters": [
{
"$ref": "#/parameters/account_id"
},
{
"$ref": "#/parameters/team_id"
}
],
"get": {
"tags": [
"Teams"
],
"operationId": "get-team-members",
"summary": "List Agents in Team",
"description": "Get Details of Agents in an Team",
"security": [
{
"userApiKey": [
]
}
],
"parameters": [
{
"$ref": "#/parameters/team_id"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"description": "Array of all agents in the team",
"items": {
"$ref": "#/definitions/agent"
}
}
},
"404": {
"description": "Inbox not found"
},
"403": {
"description": "Access denied"
}
}
},
"post": {
"tags": [
"Teams"
],
"operationId": "add-new-agent-to-team",
"summary": "Add a New Agent",
"description": "Add a new Agent to Team",
"security": [
{
"userApiKey": [
]
}
],
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"required": [
"user_ids"
],
"properties": {
"user_ids": {
"type": "array",
"items": {
"type": "integer"
},
"description": "IDs of users to be added to the team"
}
}
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"description": "Array of all active agents",
"items": {
"$ref": "#/definitions/agent"
}
}
},
"404": {
"description": "Team not found"
},
"403": {
"description": "Access denied"
},
"422": {
"description": "User must exist"
}
}
},
"patch": {
"tags": [
"Teams"
],
"operationId": "update-agents-in-team",
"summary": "Update Agents in Team",
"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": [
"user_ids"
],
"properties": {
"user_ids": {
"type": "array",
"items": {
"type": "integer"
},
"description": "IDs of users to be added to the team"
}
}
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"description": "Array of all agents in the team",
"items": {
"$ref": "#/definitions/agent"
}
}
},
"404": {
"description": "Team not found"
},
"403": {
"description": "Access denied"
},
"422": {
"description": "User must exist"
}
}
},
"delete": {
"tags": [
"Teams"
],
"operationId": "delete-agent-in-team",
"summary": "Remove an Agent from Team",
"description": "Remove an Agent from Team",
"security": [
{
"userApiKey": [
]
}
],
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"required": [
"team_id",
"user_ids"
],
"properties": {
"user_ids": {
"type": "array",
"items": {
"type": "integer"
},
"description": "IDs of users to be deleted from the team"
}
}
}
}
],
"responses": {
"200": {
"description": "Success"
},
"404": {
"description": "Team not found"
},
"403": {
"description": "Access denied"
},
"422": {
"description": "User must exist"
}
}
}
},
"/api/v1/accounts/{account_id}/custom_filters": {
"parameters": [
{
@ -3433,7 +3649,7 @@
],
"get": {
"tags": [
"Custom Filter"
"Custom Filters"
],
"operationId": "list-all-filters",
"summary": "List all custom filters",
@ -3456,7 +3672,7 @@
},
"post": {
"tags": [
"Custom Filter"
"Custom Filters"
],
"operationId": "create-a-custom-filter",
"summary": "Create a custom filter",
@ -3498,7 +3714,7 @@
],
"get": {
"tags": [
"Custom Filter"
"Custom Filters"
],
"operationId": "get-details-of-a-single-custom-filter",
"summary": "Get a custom filter details",
@ -3520,7 +3736,7 @@
},
"patch": {
"tags": [
"Custom Filter"
"Custom Filters"
],
"operationId": "update-a-custom-filter",
"summary": "Update a custom filter",
@ -3549,7 +3765,7 @@
},
"delete": {
"tags": [
"Custom Filter"
"Custom Filters"
],
"operationId": "delete-a-custom-filter",
"summary": "Delete a custom filter",
@ -5084,7 +5300,7 @@
},
"team_id": {
"in": "path",
"name": "id",
"name": "team_id",
"type": "integer",
"required": true,
"description": "The ID of the team to be updated"
@ -5221,18 +5437,18 @@
"name": "Application",
"tags": [
"Account AgentBots",
"Agent",
"Canned Response",
"Contact",
"Conversation",
"Agents",
"Canned Responses",
"Contacts",
"Conversations",
"Conversation Assignment",
"Conversation Labels",
"Inbox",
"Inboxes",
"Messages",
"Integrations",
"Profile",
"Teams",
"Custom Filter",
"Custom Filters",
"Reports"
]
},