Fix: Make swagger doc compliant to OpenAPI (#3394)

This fixes issues in the swagger.json file. The motivation to do so is to be able to generate API clients using https://openapi-generator.tech Doing so will require further changes to the api spec, but this seems like a good first step since it is now "valid" according to editor.swagger.io and openapi-generator validate.

Fixes #2806
This commit is contained in:
Jan-David 2021-11-17 14:25:15 +01:00 committed by GitHub
parent d227a56747
commit e500d1216b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 527 additions and 695 deletions

View file

@ -7,7 +7,7 @@ defaults: &defaults
working_directory: ~/build working_directory: ~/build
docker: docker:
# specify the version you desire here # specify the version you desire here
- image: cimg/ruby:3.0.2-node - image: cimg/ruby:3.0.2-browsers
# Specify service dependencies here if necessary # Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images # CircleCI maintains a library of pre-built images
@ -77,6 +77,18 @@ jobs:
paths: paths:
- cc-test-reporter - cc-test-reporter
# verify swagger specification
- run:
name: Verify swagger API specification
command: |
bundle exec rake swagger:build
if [[ `git status swagger/swagger.json --porcelain` ]]
then
echo "ERROR: The swagger.json file is not in sync with the yaml specification. Run 'rake swagger:build' and commit 'swagger/swagger.json'."
exit 1
fi
curl -L https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar > ~/tmp/openapi-generator-cli-5.3.0.jar
java -jar ~/tmp/openapi-generator-cli-5.3.0.jar validate -i swagger/swagger.json
# Database setup # Database setup
- run: yarn install --check-files - run: yarn install --check-files
- run: bundle exec rake db:create - run: bundle exec rake db:create

View file

@ -1,8 +1,9 @@
type: object type: object
required:
- inbox_id
properties: properties:
inbox_id: inbox_id:
type: number type: number
required: true
name: name:
type: string type: string
description: name of the contact description: name of the contact
@ -12,7 +13,7 @@ properties:
phone_number: phone_number:
type: string type: string
description: phone number of the contact description: phone number of the contact
identifier: identifier:
type: string type: string
description: A unique identifier for the contact in external system description: A unique identifier for the contact in external system
custom_attributes: custom_attributes:

View file

@ -1,9 +1,10 @@
type: object type: object
required:
- content
properties: properties:
content: content:
type: string type: string
description: The content of the message description: The content of the message
required: true
message_type: message_type:
type: string type: string
enum: ['outgoing', 'incoming'] enum: ['outgoing', 'incoming']
@ -18,4 +19,3 @@ properties:
content_attributes: content_attributes:
type: object type: object
description: attributes based on your content type description: attributes based on your content type

View file

@ -5,6 +5,8 @@ properties:
description: ID of the conversation description: ID of the conversation
messages: messages:
type: array type: array
items:
$ref: '#/definitions/message'
account_id: account_id:
type: number type: number
description: Account Id description: Account Id
@ -21,7 +23,7 @@ properties:
contact_last_seen_at: contact_last_seen_at:
type: string type: string
agent_last_seen_at: agent_last_seen_at:
type: agent_last_seen_at type: string
unread_count: unread_count:
type: number type: number
description: The number of unread messages description: The number of unread messages

View file

@ -14,8 +14,10 @@ properties:
type: object type: object
description: A query that needs to be saved as a custom filter description: A query that needs to be saved as a custom filter
created_at: created_at:
type: datetime type: string
format: date-time
description: The time at which the custom filter was created description: The time at which the custom filter was created
updated_at: updated_at:
type: datetime type: string
format: date-time
description: The time at which the custom filter was updated description: The time at which the custom filter was updated

View file

@ -20,4 +20,6 @@ properties:
description: Whether multiple hooks can be created for the integration description: Whether multiple hooks can be created for the integration
hooks: hooks:
type: array type: array
items:
type: object
description: If there are any hooks created for this integration description: If there are any hooks created for this integration

View file

@ -1,5 +1,5 @@
type: object type: object
properties: properties:
id: id:
type: integer type: integer
description: Id of the conversation description: Id of the conversation
@ -8,7 +8,9 @@ properties:
description: The inbox id of the conversation description: The inbox id of the conversation
messages: messages:
type: array type: array
items:
$ref: '#/definitions/message'
description: Messages in the conversation description: Messages in the conversation
contact: contact:
type: object type: object
description: The contact information associated to the conversation description: The contact information associated to the conversation

View file

@ -1,5 +1,5 @@
type: object type: object
properties: properties:
id: id:
type: string type: string
description: Id of the message description: Id of the message
@ -23,6 +23,8 @@ properties:
description: Conversation Id of the message description: Conversation Id of the message
attachments: attachments:
type: array type: array
items:
type: object
description: Attachments if any description: Attachments if any
sender: sender:
type: object type: object

View file

@ -10,7 +10,7 @@ info:
name: MIT License name: MIT License
url: https://opensource.org/licenses/MIT url: https://opensource.org/licenses/MIT
host: app.chatwoot.com host: app.chatwoot.com
basePath: basePath: /
schemes: schemes:
- https - https
produces: produces:

View file

@ -1,6 +1,5 @@
in: path in: path
name: account_id name: account_id
schema: type: integer
type: integer
required: true required: true
description: The numeric ID of the account description: The numeric ID of the account

View file

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

View file

@ -1,15 +1,14 @@
in: query in: query
name: sort name: sort
schema: type: string
type: string enum:
enum: - name
- name - email
- email - phone_number
- phone_number - last_activity_at
- last_activity_at - -name
- -name - -email
- -email - -phone_number
- -phone_number - -last_activity_at
- -last_activity_at
required: false required: false
description: The attribute by which list should be sorted description: The attribute by which list should be sorted

View file

@ -1,6 +1,5 @@
in: path in: path
name: conversation_id name: conversation_id
schema: type: integer
type: integer
required: true required: true
description: The numeric ID of the conversation description: The numeric ID of the conversation

View file

@ -1,6 +1,5 @@
in: path in: path
name: custom_filter_id name: custom_filter_id
schema: type: integer
type: integer
required: true required: true
description: The numeric ID of the custom filter description: The numeric ID of the custom filter

View file

@ -1,6 +1,5 @@
in: path in: path
name: hook_id name: hook_id
schema: type: integer
type: integer
required: true required: true
description: The numeric ID of the integration hook description: The numeric ID of the integration hook

View file

@ -1,6 +1,5 @@
in: path in: path
name: inbox_id name: inbox_id
schema: type: integer
type: integer
required: true required: true
description: The ID of the Inbox description: The ID of the Inbox

View file

@ -1,6 +1,5 @@
in: path in: path
name: message_id name: message_id
schema: type: integer
type: integer
required: true required: true
description: The numeric ID of the message description: The numeric ID of the message

View file

@ -1,7 +1,6 @@
in: query in: query
name: page name: page
schema: type: integer
type: integer default: 1
default: 1
required: false required: false
description: The page parameter description: The page parameter

View file

@ -1,6 +1,5 @@
in: path in: path
name: id name: id
schema: type: integer
type: integer
required: true required: true
description: The numeric ID of the user on the platform description: The numeric ID of the user on the platform

View file

@ -1,6 +1,5 @@
in: path in: path
name: contact_identifier name: contact_identifier
schema: type: string
type: string
required: true required: true
description: The source id of contact obtained on contact create description: The source id of contact obtained on contact create

View file

@ -1,6 +1,5 @@
in: path in: path
name: inbox_identifier name: inbox_identifier
schema: type: string
type: string
required: true required: true
description: The identifier obtained from API inbox channel description: The identifier obtained from API inbox channel

View file

@ -1,7 +1,12 @@
in: query in: query
name: metric name: metric
schema: type: string
type: string enum:
enum: [conversations_count, incoming_messages_count, outgoing_messages_count, avg_first_response_time, avg_resolution_time, resolutions_count] - conversations_count
- incoming_messages_count
- outgoing_messages_count
- avg_first_response_time
- avg_resolution_time
- resolutions_count
required: true required: true
description: The type of metric description: The type of metric

View file

@ -1,7 +1,11 @@
in: query in: query
name: report_type name: report_type
schema: type: string
type: string enum:
enum: [account,agent,inbox,label,team] - account
- agent
- inbox
- label
- team
required: true required: true
description: Type of report description: Type of report

View file

@ -1,2 +1,5 @@
in: path
name: source_id
required: true
type: string type: string
description: "Id of the session for which the conversation is created.\n\n\n\n Source Ids can be obtained through contactable inboxes API or via generated.<br/><br/>Website: Chatwoot generated string which can be obtained from webhook events. <br/> Phone Channels(Twilio): Phone number in e164 format <br/> Email Channels: Contact Email address <br/> API Channel: Any Random String" description: "Id of the session for which the conversation is created.\n\n\n\n Source Ids can be obtained through contactable inboxes API or via generated.<br/><br/>Website: Chatwoot generated string which can be obtained from webhook events. <br/> Phone Channels(Twilio): Phone number in e164 format <br/> Email Channels: Contact Email address <br/> API Channel: Any Random String"

View file

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

View file

@ -10,7 +10,7 @@ responses:
type: array type: array
description: 'Array of agent bots' description: 'Array of agent bots'
items: items:
- $ref: '#/definitions/agent_bot' $ref: '#/definitions/agent_bot'
401: 401:
description: Unauthorized description: Unauthorized

View file

@ -11,21 +11,22 @@ parameters:
required: true required: true
schema: schema:
type: object type: object
required:
- name
- email
- role
properties: properties:
name: name:
type: string type: string
description: Full Name of the agent description: Full Name of the agent
required: true
email: email:
type: string type: string
description: Email of the Agent description: Email of the Agent
required: true role:
role:
type: string type: string
enum: ['agent', 'administrator'] enum: ['agent', 'administrator']
description: Whether its administrator or agent description: Whether its administrator or agent
required: true availability_status:
availability_status:
type: string type: string
enum: ['available', 'busy', 'offline'] enum: ['available', 'busy', 'offline']
description: The availability setting of the agent. description: The availability setting of the agent.

View file

@ -8,8 +8,7 @@ security:
parameters: parameters:
- in: path - in: path
name: id name: id
schema: type: integer
type: integer
required: true required: true
description: The ID of the agent to be deleted description: The ID of the agent to be deleted
responses: responses:

View file

@ -8,8 +8,7 @@ security:
parameters: parameters:
- in: path - in: path
name: id name: id
schema: type: integer
type: integer
required: true required: true
description: The ID of the agent to be updated. description: The ID of the agent to be updated.
- name: data - name: data
@ -17,13 +16,14 @@ parameters:
required: true required: true
schema: schema:
type: object type: object
required:
- role
properties: properties:
role: role:
type: string type: string
enum: ['agent', 'administrator'] enum: ['agent', 'administrator']
description: Whether its administrator or agent description: Whether its administrator or agent
required: true availability:
availability:
type: string type: string
enum: ['available', 'busy', 'offline'] enum: ['available', 'busy', 'offline']
description: The availability setting of the agent. description: The availability setting of the agent.
@ -39,4 +39,4 @@ responses:
404: 404:
description: Agent not found description: Agent not found
403: 403:
description: Access denied description: Access denied

View file

@ -16,13 +16,15 @@ post:
required: true required: true
schema: schema:
type: object type: object
required:
- inbox_id
properties: properties:
inbox_id: inbox_id:
type: number type: number
description: The ID of the inbox description: The ID of the inbox
required: true
source_id: source_id:
$ref: '#/parameters/source_id' type: string
description: Contact Inbox Source Id
responses: responses:
200: 200:
description: Success description: Success

View file

@ -1,16 +1,17 @@
parameters:
- $ref: '#/parameters/account_id'
- name: id
in: path
type: number
description: ID of the contact
required: true
get: get:
tags: tags:
- Contact - Contact
operationId: contactDetails operationId: contactDetails
summary: Show Contact summary: Show Contact
description: Get a contact belonging to the account using ID description: Get a contact belonging to the account using ID
parameters:
- $ref: '#/parameters/account_id'
- name: id
in: path
type: number
description: ID of the contact
required: true
responses: responses:
200: 200:
description: Success description: Success
@ -28,12 +29,6 @@ put:
summary: Update Contact summary: Update Contact
description: Update a contact belonging to the account using ID description: Update a contact belonging to the account using ID
parameters: parameters:
- $ref: '#/parameters/account_id'
- name: id
in: path
type: number
description: ID of the contact
required: true
- name: data - name: data
in: body in: body
required: true required: true
@ -54,16 +49,10 @@ delete:
- Contact - Contact
operationId: contactDelete operationId: contactDelete
summary: Delete Contact summary: Delete Contact
parameters:
- name: id
in: path
type: number
description: ID of the contact
required: true
responses: responses:
200: 200:
description: Success description: Success
401: 401:
description: Unauthorized description: Unauthorized
404: 404:
description: Contact not found description: Contact not found

View file

@ -1,41 +0,0 @@
get:
tags:
- Conversation
operationId: conversationList
description: List all the conversations with pagination
summary: Conversations List
parameters:
- $ref: '#/parameters/account_id'
- name: assignee_type
in: query
type: string
enum: ['me', 'unassigned', 'all', 'assigned']
required: true
- name: status
in: query
type: string
enum: ['open', 'resolved', 'pending']
required: true
- name: page
in: query
type: integer
required: true
- name: inbox_id
in: query
type: integer
- name: labels
in: query
type: array
items:
type: string
responses:
200:
description: Success
schema:
$ref: '#/definitions/conversation_list'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/bad_request_error'
description: Access denied

View file

@ -1,44 +1,43 @@
post: tags:
tags: - Conversation
- Conversation operationId: conversationFilter
operationId: conversationFilter description: Filter conversations with custom filter options and pagination
description: Filter conversations with custom filter options and pagination summary: Conversations Filter
summary: Conversations Filter security:
security: - userApiKey: []
- userApiKey: [] - agentBotApiKey: []
- agentBotApiKey: [] parameters:
parameters: - name: page
- name: page in: query
in: query type: integer
type: integer - name: payload
- name: payload in: body
in: body required: true
required: true schema:
schema: type: array
type: array items:
items: type: object
type: object properties:
properties: attribute_key:
attribute_key: type: string
description: filter attribute name
filter_operator:
type: string
description: filter operator name
values:
type: array
items:
type: string type: string
description: filter attribute name description: array of the attribute values to filter
filter_operator: query_operator:
type: string type: string
description: filter operator name description: query operator name
values: responses:
type: array 200:
description: array of the attribute values to filter description: Success
query_operator: schema:
type: string $ref: '#/definitions/conversation_list'
description: query operator name 400:
- $ref: '#/parameters/account_id' description: Bad Request Error
responses: schema:
200: $ref: '#/definitions/bad_request_error'
description: Success
schema:
$ref: '#/definitions/conversation_list'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/bad_request_error'
description: Access denied

View file

@ -1,24 +1,27 @@
parameters:
- $ref: '#/parameters/account_id'
get: get:
tags: tags:
- Conversation - Conversation
operationId: conversationSearch operationId: conversationList
description: Search for conversations containing a messages with the query string description: List all the conversations with pagination
summary: Conversations Search summary: Conversations List
parameters: parameters:
- name: q
in: query
type: string
- name: assignee_type - name: assignee_type
in: query in: query
type: string type: string
enum: ['me', 'unassigned', 'all', 'assigned'] enum: ['me', 'unassigned', 'all', 'assigned']
required: true
- name: status - name: status
in: query in: query
type: string type: string
enum: ['open', 'resolved', 'pending', 'all'] enum: ['open', 'resolved', 'pending']
required: true
- name: page - name: page
in: query in: query
type: integer type: integer
required: true
- name: inbox_id - name: inbox_id
in: query in: query
type: integer type: integer
@ -27,7 +30,6 @@ get:
type: array type: array
items: items:
type: string type: string
- $ref: '#/parameters/account_id'
responses: responses:
200: 200:
@ -38,8 +40,6 @@ get:
description: Bad Request Error description: Bad Request Error
schema: schema:
$ref: '#/definitions/bad_request_error' $ref: '#/definitions/bad_request_error'
description: Access denied
post: post:
tags: tags:
@ -51,7 +51,6 @@ post:
- userApiKey: [] - userApiKey: []
- agentBotApiKey: [] - agentBotApiKey: []
parameters: parameters:
- $ref: '#/parameters/account_id'
- name: data - name: data
in: body in: body
required: true required: true
@ -59,7 +58,8 @@ post:
type: object type: object
properties: properties:
source_id: source_id:
$ref: '#/parameters/source_id' type: string
description: Conversation source id
inbox_id: inbox_id:
type: string type: string
description: "Id of inbox in which the conversation is created <br/> Allowed Inbox Types: Website, Phone, Api, Email " description: "Id of inbox in which the conversation is created <br/> Allowed Inbox Types: Website, Phone, Api, Email "

View file

@ -13,7 +13,7 @@ parameters:
labels: labels:
type: array type: array
description: Array of labels (comma-separated strings) description: Array of labels (comma-separated strings)
properties: items:
type: string type: string
responses: responses:
200: 200:

View file

@ -31,7 +31,8 @@ post:
type: array type: array
description: The files to be uploaded. description: The files to be uploaded.
items: items:
type: file type: string
format: binary
responses: responses:

View file

@ -6,12 +6,13 @@ description: List all messages of a conversation
responses: responses:
200: 200:
description: Success description: Success
type: array
description: Array of messages
schema: schema:
allOf: type: array
- $ref: '#/definitions/generic_id' description: Array of messages
- $ref: '#/definitions/message' items:
allOf:
- $ref: '#/definitions/generic_id'
- $ref: '#/definitions/message'
404: 404:
description: Conversation not found description: Conversation not found
401: 401:

View file

@ -12,11 +12,12 @@ parameters:
required: true required: true
schema: schema:
type: object type: object
required:
- status
properties: properties:
status: status:
type: string type: string
enum: ["open", "resolved", "pending"] enum: ["open", "resolved", "pending"]
required: true
description: The status of the conversation description: The status of the conversation
responses: responses:
200: 200:

View file

@ -16,7 +16,8 @@ post:
type: string type: string
description: The name of the inbox description: The name of the inbox
avatar: avatar:
type: file type: string
format: binary
description: File for avatar image description: File for avatar image
channel: channel:
type: object type: object

View file

@ -11,15 +11,18 @@ parameters:
required: true required: true
schema: schema:
type: object type: object
required:
- inbox_id
- user_ids
properties: properties:
inbox_id: inbox_id:
type: string type: string
description: The ID of the inbox description: The ID of the inbox
required: true user_ids:
user_ids:
type: array type: array
items:
type: integer
description: IDs of users to be added to the inbox description: IDs of users to be added to the inbox
required: true
responses: responses:
200: 200:
description: Success description: Success

View file

@ -11,15 +11,18 @@ parameters:
required: true required: true
schema: schema:
type: object type: object
required:
- inbox_id
- user_ids
properties: properties:
inbox_id: inbox_id:
type: string type: string
description: The ID of the inbox description: The ID of the inbox
required: true user_ids:
user_ids:
type: array type: array
items:
type: integer
description: IDs of users to be deleted from the inbox description: IDs of users to be deleted from the inbox
required: true
responses: responses:
200: 200:
description: Success description: Success

View file

@ -2,7 +2,7 @@ tags:
- Inbox - Inbox
operationId: update-agents-in-inbox operationId: update-agents-in-inbox
summary: Update Agents in Inbox summary: Update Agents in Inbox
description: All agents execept the one passed in params will be removed description: All agents except the one passed in params will be removed
security: security:
- userApiKey: [] - userApiKey: []
parameters: parameters:
@ -11,15 +11,18 @@ parameters:
required: true required: true
schema: schema:
type: object type: object
required:
- inbox_id
- user_ids
properties: properties:
inbox_id: inbox_id:
type: string type: string
description: The ID of the inbox description: The ID of the inbox
required: true user_ids:
user_ids:
type: array type: array
items:
type: integer
description: IDs of users to be added to the inbox description: IDs of users to be added to the inbox
required: true
responses: responses:
200: 200:
description: Success description: Success

View file

@ -16,10 +16,11 @@ post:
required: true required: true
schema: schema:
type: object type: object
required:
- agent_bot
properties: properties:
agent_bot: agent_bot:
type: number type: number
required: true
description: 'Agent bot ID' description: 'Agent bot ID'
responses: responses:
204: 204:

View file

@ -16,17 +16,18 @@ patch:
required: true required: true
schema: schema:
type: object type: object
required:
- enable_auto_assignment
properties: properties:
name: name:
type: string type: string
description: The name of the inbox description: The name of the inbox
enable_auto_assignment: enable_auto_assignment:
type: boolean type: boolean
required: true
description: 'Enable Auto Assignment' description: 'Enable Auto Assignment'
avatar: avatar:
type: file type: string
required: false format: binary
description: 'Image file for avatar' description: 'Image file for avatar'
channel: channel:
type: object type: object

View file

@ -2,10 +2,10 @@
# Accounts # Accounts
platform/api/v1/accounts: /platform/api/v1/accounts:
post: post:
$ref: ./platform/accounts/create.yml $ref: ./platform/accounts/create.yml
platform/api/v1/accounts/{id}: /platform/api/v1/accounts/{account_id}:
parameters: parameters:
- $ref: '#/parameters/account_id' - $ref: '#/parameters/account_id'
get: get:
@ -18,7 +18,7 @@ platform/api/v1/accounts/{id}:
# Account Users # Account Users
platform/api/v1/accounts/{id}/account_users: /platform/api/v1/accounts/{account_id}/account_users:
parameters: parameters:
- $ref: '#/parameters/account_id' - $ref: '#/parameters/account_id'
get: get:
@ -30,12 +30,12 @@ platform/api/v1/accounts/{id}/account_users:
# AgentBots # AgentBots
platform/api/v1/agent_bots: /platform/api/v1/agent_bots:
get: get:
$ref: ./platform/agent_bots/index.yml $ref: ./platform/agent_bots/index.yml
post: post:
$ref: ./platform/agent_bots/create.yml $ref: ./platform/agent_bots/create.yml
platform/api/v1/agent_bots/{id}: /platform/api/v1/agent_bots/{id}:
parameters: parameters:
- $ref: '#/parameters/agent_bot_id' - $ref: '#/parameters/agent_bot_id'
get: get:
@ -47,10 +47,10 @@ platform/api/v1/agent_bots/{id}:
# Users # Users
platform/api/v1/users: /platform/api/v1/users:
post: post:
$ref: ./platform/users/create.yml $ref: ./platform/users/create.yml
platform/api/v1/users/{id}: /platform/api/v1/users/{id}:
parameters: parameters:
- $ref: '#/parameters/platform_user_id' - $ref: '#/parameters/platform_user_id'
get: get:
@ -59,10 +59,11 @@ platform/api/v1/users/{id}:
$ref: ./platform/users/update.yml $ref: ./platform/users/update.yml
delete: delete:
$ref: ./platform/users/delete.yml $ref: ./platform/users/delete.yml
platform/api/v1/users/{id}/login: /platform/api/v1/users/{id}/login:
parameters: parameters:
- $ref: '#/parameters/platform_user_id' - $ref: '#/parameters/platform_user_id'
$ref: './platform/users/login.yml' get:
$ref: './platform/users/login.yml'
# ---------------- end of platform path -----------# # ---------------- end of platform path -----------#
@ -71,12 +72,12 @@ platform/api/v1/users/{id}/login:
# Contacts # Contacts
public/api/v1/inboxes/{inbox_identifier}/contacts: /public/api/v1/inboxes/{inbox_identifier}/contacts:
parameters: parameters:
- $ref: '#/parameters/public_inbox_identifier' - $ref: '#/parameters/public_inbox_identifier'
post: post:
$ref: ./public/inboxes/contacts/create.yml $ref: ./public/inboxes/contacts/create.yml
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}: /public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}:
parameters: parameters:
- $ref: '#/parameters/public_inbox_identifier' - $ref: '#/parameters/public_inbox_identifier'
- $ref: '#/parameters/public_contact_identifier' - $ref: '#/parameters/public_contact_identifier'
@ -86,7 +87,7 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}:
$ref: ./public/inboxes/contacts/update.yml $ref: ./public/inboxes/contacts/update.yml
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations: /public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations:
parameters: parameters:
- $ref: '#/parameters/public_inbox_identifier' - $ref: '#/parameters/public_inbox_identifier'
- $ref: '#/parameters/public_contact_identifier' - $ref: '#/parameters/public_contact_identifier'
@ -95,7 +96,7 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
get: get:
$ref: ./public/inboxes/conversations/index.yml $ref: ./public/inboxes/conversations/index.yml
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages: /public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages:
parameters: parameters:
- $ref: '#/parameters/public_inbox_identifier' - $ref: '#/parameters/public_inbox_identifier'
- $ref: '#/parameters/public_contact_identifier' - $ref: '#/parameters/public_contact_identifier'
@ -104,7 +105,7 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
$ref: ./public/inboxes/messages/create.yml $ref: ./public/inboxes/messages/create.yml
get: get:
$ref: ./public/inboxes/messages/index.yml $ref: ./public/inboxes/messages/index.yml
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}: /public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}:
parameters: parameters:
- $ref: '#/parameters/public_inbox_identifier' - $ref: '#/parameters/public_inbox_identifier'
- $ref: '#/parameters/public_contact_identifier' - $ref: '#/parameters/public_contact_identifier'
@ -139,11 +140,15 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
# Agents # Agents
/api/v1/accounts/{account_id}/agents: /api/v1/accounts/{account_id}/agents:
parameters:
- $ref: '#/parameters/account_id'
get: get:
$ref: ./application/agents/index.yml $ref: ./application/agents/index.yml
post: post:
$ref: ./application/agents/create.yml $ref: ./application/agents/create.yml
/api/v1/accounts/{account_id}/agents/{id}: /api/v1/accounts/{account_id}/agents/{id}:
parameters:
- $ref: '#/parameters/account_id'
patch: patch:
$ref: ./application/agents/update.yml $ref: ./application/agents/update.yml
delete: delete:
@ -167,18 +172,13 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
# Conversations # Conversations
/api/v1/accounts/{account_id}/conversations: /api/v1/accounts/{account_id}/conversations:
parameters:
- $ref: '#/parameters/account_id'
$ref: ./application/conversation/index.yml $ref: ./application/conversation/index.yml
/api/v1/accounts/{account_id}/conversations/:
parameters:
- $ref: '#/parameters/account_id'
$ref: ./application/conversation/create.yml
/api/v1/accounts/{account_id}/conversations/filter: /api/v1/accounts/{account_id}/conversations/filter:
parameters: parameters:
- $ref: '#/parameters/account_id' - $ref: '#/parameters/account_id'
$ref: ./application/conversation/filter.yml post:
/api/v1/accounts/{account_id}/conversations/{converstion_id}: $ref: ./application/conversation/filter.yml
/api/v1/accounts/{account_id}/conversations/{conversation_id}:
parameters: parameters:
- $ref: '#/parameters/account_id' - $ref: '#/parameters/account_id'
- $ref: '#/parameters/conversation_id' - $ref: '#/parameters/conversation_id'
@ -227,7 +227,10 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
$ref: ./application/inboxes/set_agent_bot.yml $ref: ./application/inboxes/set_agent_bot.yml
# Inbox Members # Inbox Members
/api/v1/accounts/{account_id}/inbox_members: /api/v1/accounts/{account_id}/inbox_members/{inbox_id}:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/inbox_id'
get: get:
$ref: ./application/inboxes/inbox_members/show.yml $ref: ./application/inboxes/inbox_members/show.yml
post: post:
@ -240,9 +243,7 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
# Messages # Messages
/api/v1/accounts/{account_id}/conversations/{id}/messages: /api/v1/accounts/{account_id}/conversations/{conversation_id}/messages:
$ref: ./application/conversation/messages/create_attachment.yml
/api/v1/accounts/{account_id}/conversations/{converstion_id}/messages:
parameters: parameters:
- $ref: '#/parameters/account_id' - $ref: '#/parameters/account_id'
- $ref: '#/parameters/conversation_id' - $ref: '#/parameters/conversation_id'
@ -269,6 +270,7 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
/api/v1/accounts/{account_id}/integrations/hooks: /api/v1/accounts/{account_id}/integrations/hooks:
post: post:
$ref: './application/integrations/hooks/create.yml' $ref: './application/integrations/hooks/create.yml'
/api/v1/accounts/{account_id}/integrations/hooks/{hook_id}:
patch: patch:
$ref: ./application/integrations/hooks/update.yml $ref: ./application/integrations/hooks/update.yml
delete: delete:
@ -308,9 +310,8 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
- $ref: '#/parameters/account_id' - $ref: '#/parameters/account_id'
- in: query - in: query
name: filter_type name: filter_type
schema: type: string
type: string enum: ['conversation', 'contact', 'report']
enum: ['conversation', 'contact', 'report']
required: false required: false
description: The type of custom filter description: The type of custom filter
get: get:
@ -331,48 +332,42 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
### Reports ### Reports
# List # List
/api/v2/accounts/{id}/reports: /api/v2/accounts/{account_id}/reports:
parameters: parameters:
- $ref: '#/parameters/account_id' - $ref: '#/parameters/account_id'
- $ref: '#/parameters/report_metric' - $ref: '#/parameters/report_metric'
- $ref: '#/parameters/report_type' - $ref: '#/parameters/report_type'
- in: query - in: query
name: id name: id
schema: type: string
type: string
description: The Id of specific object in case of agent/inbox/label description: The Id of specific object in case of agent/inbox/label
- in: query - in: query
name: since name: since
schema: type: string
type: string
description: The timestamp from where report should start. description: The timestamp from where report should start.
- in: query - in: query
name: until name: until
schema: type: string
type: string
description: The timestamp from where report should stop. description: The timestamp from where report should stop.
get: get:
$ref: './application/reports/index.yml' $ref: './application/reports/index.yml'
# Summary # Summary
/api/v2/accounts/{id}/reports/summary: /api/v2/accounts/{account_id}/reports/summary:
parameters: parameters:
- $ref: '#/parameters/account_id' - $ref: '#/parameters/account_id'
- $ref: '#/parameters/report_type' - $ref: '#/parameters/report_type'
- in: query - in: query
name: id name: id
schema: type: string
type: string
description: The Id of specific object in case of agent/inbox/label description: The Id of specific object in case of agent/inbox/label
- in: query - in: query
name: since name: since
schema: type: string
type: string
description: The timestamp from where report should start. description: The timestamp from where report should start.
- in: query - in: query
name: until name: until
schema: type: string
type: string
description: The timestamp from where report should stop. description: The timestamp from where report should stop.
get: get:
$ref: './application/reports/summary.yml' $ref: './application/reports/summary.yml'

View file

@ -11,15 +11,16 @@ parameters:
required: true required: true
schema: schema:
type: object type: object
required:
- user_id
- role
properties: properties:
user_id: user_id:
type: integer type: integer
description: The ID of the user description: The ID of the user
required: true
role: role:
type: string type: string
description: whether user is an administrator or agent description: whether user is an administrator or agent
required: true
responses: responses:
200: 200:

View file

@ -11,11 +11,12 @@ parameters:
required: true required: true
schema: schema:
type: object type: object
required:
- user_id
properties: properties:
user_id: user_id:
type: integer type: integer
description: The ID of the user description: The ID of the user
required: true
responses: responses:
200: 200:

View file

@ -1,21 +1,20 @@
get: tags:
tags: - Users
- Users operationId: get-sso-url-of-a-user
operationId: get-sso-url-of-a-user summary: Get User SSO Link
summary: Get User SSO Link description: Get the sso link of a user
description: Get the sso link of a user security:
security: - platformAppApiKey: []
- platformAppApiKey: [] responses:
responses: 200:
200: description: Success
description: Success schema:
schema: type: object
type: object properties:
properties: url:
url: type: string
type: string description: SSO url to autenticate the user
description: SSO url to autenticate the user 401:
401: description: Unauthorized
description: Unauthorized 404:
404: description: The given user does not exist
description: The given user does not exist

View file

@ -3,8 +3,7 @@ tags:
operationId: create-a-contact operationId: create-a-contact
summary: Create a contact summary: Create a contact
description: Create a contact description: Create a contact
security: security: []
- nil
parameters: parameters:
- name: data - name: data
in: body in: body

View file

@ -3,8 +3,7 @@ tags:
operationId: get-details-of-a-contact operationId: get-details-of-a-contact
summary: Get a contact summary: Get a contact
description: Get the details of a contact description: Get the details of a contact
security: security: []
- nil
responses: responses:
200: 200:
description: Success description: Success

View file

@ -3,8 +3,7 @@ tags:
operationId: update-a-contact operationId: update-a-contact
summary: Update a contact summary: Update a contact
description: Update a contact's attributes description: Update a contact's attributes
security: security: []
- nil
parameters: parameters:
- name: data - name: data
in: body in: body

View file

@ -3,8 +3,7 @@ tags:
operationId: create-a-conversation operationId: create-a-conversation
summary: Create a conversation summary: Create a conversation
description: Create a conversation description: Create a conversation
security: security: []
- nil
responses: responses:
200: 200:
description: Success description: Success

View file

@ -3,8 +3,7 @@ tags:
operationId: create-a-message operationId: create-a-message
summary: Create a message summary: Create a message
description: Create a message description: Create a message
security: security: []
- nil
parameters: parameters:
- name: data - name: data
in: body in: body

View file

@ -3,8 +3,7 @@ tags:
operationId: update-a-message operationId: update-a-message
summary: Update a message summary: Update a message
description: Update a message description: Update a message
security: security: []
- nil
parameters: parameters:
- name: data - name: data
in: body in: body

File diff suppressed because it is too large Load diff