mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-30 02:32:29 +00:00
feat: Update swagger to openapi 3.0.4, update request payloads with examples (#11533)
# Pull Request Template ## Description Updates the public swagger spec to be OpenAPI 3.0.4 compliant. Regarding #7893, I'm investigating the use of [oas_rails](https://github.com/a-chacon/oas_rails) to auto-generate the documentation along with correct expected payloads. Mostly fixes #10531, related to #7893 ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality not to work as expected) - [ ] This change requires a documentation update ## How Has This Been Tested? Copied spec into swagger editor, reviewed outputs:  Note that this shows two errors with the `DELETE` endpoints as technically these should not have a `requestBody` - in which case we should be making use of another HTTP verb or another endpoint. ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have commented on my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] Any dependent changes have been merged and published in downstream modules --------- Co-authored-by: Daniel Jimenez <devildan.knex@gmail.com> Co-authored-by: Daniel Jimenez <daniel.jimenez@spark64.com>
This commit is contained in:
committed by
GitHub
parent
99de5f4257
commit
459f225559
5
Gemfile
5
Gemfile
@@ -33,6 +33,8 @@ gem 'liquid'
|
||||
gem 'commonmarker'
|
||||
# Validate Data against JSON Schema
|
||||
gem 'json_schemer'
|
||||
# used in swagger build
|
||||
gem 'json_refs'
|
||||
# Rack middleware for blocking & throttling abusive requests
|
||||
gem 'rack-attack', '>= 6.7.0'
|
||||
# a utility tool for streaming, flexible and safe downloading of remote files
|
||||
@@ -196,9 +198,6 @@ group :development do
|
||||
gem 'scss_lint', require: false
|
||||
gem 'web-console', '>= 4.2.1'
|
||||
|
||||
# used in swagger build
|
||||
gem 'json_refs'
|
||||
|
||||
# When we want to squash migrations
|
||||
gem 'squasher'
|
||||
|
||||
|
||||
28
developer-docs/README.md
Normal file
28
developer-docs/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
## Chatwoot Developer Documentation
|
||||
|
||||
Welcome to the official Chatwoot developer documentation. This guide contains everything you need to know about Chatwoot APIs and build custom flows on top of Chatwoot APIs.
|
||||
|
||||
### 👩💻 Development
|
||||
|
||||
Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command
|
||||
|
||||
```
|
||||
npm i -g mintlify
|
||||
```
|
||||
|
||||
Run the following command at the root of your documentation (where mint.json is)
|
||||
|
||||
```
|
||||
mintlify dev
|
||||
```
|
||||
|
||||
### 😎 Publishing Changes
|
||||
|
||||
Changes will be deployed to production automatically after pushing to the default branch.
|
||||
|
||||
You can also preview changes using PRs, which generates a preview link of the docs.
|
||||
|
||||
#### Troubleshooting
|
||||
|
||||
- Mintlify dev isn't running - Run `mintlify install` it'll re-install dependencies.
|
||||
- Page loads as a 404 - Make sure you are running in a folder with `mint.json`
|
||||
84
developer-docs/docs.json
Normal file
84
developer-docs/docs.json
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"name": "Chatwoot Developer Docs",
|
||||
"description": "Official developer documentation for Chatwoot - the open-source customer support platform. Learn about our APIs, integrations, and development guidelines.",
|
||||
"logo": {
|
||||
"dark": "/logo/dark.png",
|
||||
"light": "/logo/light.png"
|
||||
},
|
||||
"favicon": "/favicon.png",
|
||||
"colors": {
|
||||
"primary": "#0069ED",
|
||||
"light": "#4D9CFF",
|
||||
"dark": "#0050B4"
|
||||
},
|
||||
"theme": "maple",
|
||||
"navigation": {
|
||||
"tabs": [
|
||||
{
|
||||
"tab": "API Documentation",
|
||||
"groups": [
|
||||
{
|
||||
"group": "Platform API",
|
||||
"description": "APIs for managing platform aspects of Chatwoot",
|
||||
"includeTags": [
|
||||
"Accounts",
|
||||
"Account Users",
|
||||
"AgentBots",
|
||||
"Users"
|
||||
],
|
||||
"openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/platform_swagger.json"
|
||||
},
|
||||
{
|
||||
"group": "Application API",
|
||||
"description": "APIs for managing application aspects of Chatwoot",
|
||||
"includeTags": [
|
||||
"Account AgentBots",
|
||||
"Agents",
|
||||
"Canned Responses",
|
||||
"Contacts",
|
||||
"Contact Labels",
|
||||
"Conversation Assignments",
|
||||
"Conversation Labels",
|
||||
"Conversations",
|
||||
"Custom Attributes",
|
||||
"Custom Filters",
|
||||
"Inboxes",
|
||||
"Integrations",
|
||||
"Messages",
|
||||
"Profile",
|
||||
"Reports",
|
||||
"Teams",
|
||||
"Webhooks",
|
||||
"Automation Rule",
|
||||
"Help Center"
|
||||
],
|
||||
"openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/application_swagger.json"
|
||||
},
|
||||
{
|
||||
"group": "Client API",
|
||||
"description": "APIs for client applications",
|
||||
"includeTags": [
|
||||
"Contacts API",
|
||||
"Conversations API",
|
||||
"Messages API"
|
||||
],
|
||||
"openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/client_swagger.json"
|
||||
},
|
||||
{
|
||||
"group": "Other APIs",
|
||||
"description": "Other Chatwoot APIs",
|
||||
"includeTags": [
|
||||
"CSAT Survey Page"
|
||||
],
|
||||
"openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/other_swagger.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"footerSocials": {
|
||||
"twitter": "https://twitter.com/chatwootapp",
|
||||
"github": "https://github.com/chatwoot",
|
||||
"linkedin": "https://www.linkedin.com/company/chatwoot"
|
||||
}
|
||||
}
|
||||
BIN
developer-docs/favicon.png
Normal file
BIN
developer-docs/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
BIN
developer-docs/logo/dark.png
Normal file
BIN
developer-docs/logo/dark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
BIN
developer-docs/logo/light.png
Normal file
BIN
developer-docs/logo/light.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 168 KiB |
@@ -1,22 +1,156 @@
|
||||
namespace :swagger do
|
||||
desc 'build combined swagger.json file from all the fragmented definitions and paths inside swagger folder'
|
||||
task build: :environment do
|
||||
require 'json_refs'
|
||||
require 'json_refs'
|
||||
require 'fileutils'
|
||||
require 'pathname'
|
||||
require 'yaml'
|
||||
require 'json'
|
||||
|
||||
base_path = Rails.root.join('swagger')
|
||||
Dir.chdir(base_path) do
|
||||
swagger_index = YAML.safe_load(File.open('index.yml'))
|
||||
module SwaggerTaskActions
|
||||
def self.execute_build
|
||||
swagger_dir = Rails.root.join('swagger')
|
||||
# Paths relative to swagger_dir for use within Dir.chdir
|
||||
index_yml_relative_path = 'index.yml'
|
||||
swagger_json_relative_path = 'swagger.json'
|
||||
|
||||
Dir.chdir(swagger_dir) do
|
||||
# Operations within this block are relative to swagger_dir
|
||||
swagger_index_content = File.read(index_yml_relative_path)
|
||||
swagger_index = YAML.safe_load(swagger_index_content)
|
||||
|
||||
final_build = JsonRefs.call(
|
||||
swagger_index,
|
||||
resolve_local_ref: false,
|
||||
resolve_file_ref: true,
|
||||
resolve_file_ref: true, # Uses CWD (swagger_dir) for resolving file refs
|
||||
logging: true
|
||||
)
|
||||
File.write('swagger.json', JSON.pretty_generate(final_build))
|
||||
File.write(swagger_json_relative_path, JSON.pretty_generate(final_build))
|
||||
|
||||
# For user messages, provide the absolute path
|
||||
absolute_swagger_json_path = swagger_dir.join(swagger_json_relative_path)
|
||||
puts 'Swagger build was successful.'
|
||||
puts "Generated #{base_path}/swagger.json"
|
||||
puts "Generated #{absolute_swagger_json_path}"
|
||||
puts 'Go to http://localhost:3000/swagger see the changes.'
|
||||
|
||||
# Trigger dependent task
|
||||
Rake::Task['swagger:build_tag_groups'].invoke
|
||||
end
|
||||
end
|
||||
|
||||
def self.execute_build_tag_groups
|
||||
base_swagger_path = Rails.root.join('swagger')
|
||||
tag_groups_output_dir = base_swagger_path.join('tag_groups')
|
||||
full_spec_path = base_swagger_path.join('swagger.json')
|
||||
index_yml_path = base_swagger_path.join('index.yml')
|
||||
|
||||
full_spec = JSON.parse(File.read(full_spec_path))
|
||||
swagger_index = YAML.safe_load(File.read(index_yml_path))
|
||||
tag_groups = swagger_index['x-tagGroups']
|
||||
|
||||
FileUtils.mkdir_p(tag_groups_output_dir)
|
||||
|
||||
tag_groups.each do |tag_group|
|
||||
_process_tag_group(tag_group, full_spec, tag_groups_output_dir)
|
||||
end
|
||||
|
||||
puts 'Tag-specific swagger files generated successfully.'
|
||||
end
|
||||
|
||||
def self.execute_build_for_docs
|
||||
Rake::Task['swagger:build'].invoke # Ensure all swagger files are built first
|
||||
|
||||
developer_docs_public_path = Rails.root.join('developer-docs/public')
|
||||
tag_groups_in_dev_docs_path = developer_docs_public_path.join('swagger/tag_groups')
|
||||
source_tag_groups_path = Rails.root.join('swagger/tag_groups')
|
||||
|
||||
FileUtils.mkdir_p(tag_groups_in_dev_docs_path)
|
||||
puts 'Creating symlinks for developer-docs...'
|
||||
|
||||
symlink_files = %w[platform_swagger.json application_swagger.json client_swagger.json other_swagger.json]
|
||||
symlink_files.each do |file|
|
||||
_create_symlink(source_tag_groups_path.join(file), tag_groups_in_dev_docs_path.join(file))
|
||||
end
|
||||
|
||||
puts 'Symlinks created successfully.'
|
||||
puts 'You can now run the Mintlify dev server to preview the documentation.'
|
||||
end
|
||||
|
||||
# Private helper methods
|
||||
class << self
|
||||
private
|
||||
|
||||
def _process_tag_group(tag_group, full_spec, output_dir)
|
||||
group_name = tag_group['name']
|
||||
tags_in_current_group = tag_group['tags']
|
||||
|
||||
tag_spec = JSON.parse(JSON.generate(full_spec)) # Deep clone
|
||||
|
||||
tag_spec['paths'] = _filter_paths_for_tag_group(tag_spec['paths'], tags_in_current_group)
|
||||
tag_spec['tags'] = _filter_tags_for_tag_group(tag_spec['tags'], tags_in_current_group)
|
||||
|
||||
output_filename = _determine_output_filename(group_name)
|
||||
File.write(output_dir.join(output_filename), JSON.pretty_generate(tag_spec))
|
||||
end
|
||||
|
||||
def _operation_has_matching_tags?(operation, tags_in_group)
|
||||
return false unless operation.is_a?(Hash)
|
||||
|
||||
operation_tags = operation['tags']
|
||||
return false unless operation_tags.is_a?(Array)
|
||||
|
||||
operation_tags.intersect?(tags_in_group)
|
||||
end
|
||||
|
||||
def _filter_paths_for_tag_group(paths_spec, tags_in_group)
|
||||
(paths_spec || {}).filter_map do |path, path_item|
|
||||
next unless path_item.is_a?(Hash)
|
||||
|
||||
operations_with_group_tags = path_item.any? do |_method, operation|
|
||||
_operation_has_matching_tags?(operation, tags_in_group)
|
||||
end
|
||||
[path, path_item] if operations_with_group_tags
|
||||
end.to_h
|
||||
end
|
||||
|
||||
def _filter_tags_for_tag_group(tags_spec, tags_in_group)
|
||||
if tags_spec.is_a?(Array)
|
||||
tags_spec.select { |tag_definition| tags_in_group.include?(tag_definition['name']) }
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
|
||||
def _determine_output_filename(group_name)
|
||||
return 'other_swagger.json' if group_name.casecmp('others').zero?
|
||||
|
||||
sanitized_group_name = group_name.downcase.tr(' ', '_').gsub(/[^a-z0-9_]+/, '')
|
||||
"#{sanitized_group_name}_swagger.json"
|
||||
end
|
||||
|
||||
def _create_symlink(source_file_path, target_file_path)
|
||||
FileUtils.rm_f(target_file_path) # Remove existing to avoid errors
|
||||
|
||||
if File.exist?(source_file_path)
|
||||
relative_source_path = Pathname.new(source_file_path).relative_path_from(target_file_path.dirname)
|
||||
FileUtils.ln_sf(relative_source_path, target_file_path)
|
||||
else
|
||||
puts "Warning: Source file #{source_file_path} not found. Skipping symlink for #{File.basename(target_file_path)}."
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
namespace :swagger do
|
||||
desc 'build combined swagger.json file from all the fragmented definitions and paths inside swagger folder'
|
||||
task build: :environment do
|
||||
SwaggerTaskActions.execute_build
|
||||
end
|
||||
|
||||
desc 'build separate swagger files for each tag group'
|
||||
task build_tag_groups: :environment do
|
||||
SwaggerTaskActions.execute_build_tag_groups
|
||||
end
|
||||
|
||||
desc 'build swagger files and create symlinks in developer-docs'
|
||||
task build_for_docs: :environment do
|
||||
SwaggerTaskActions.execute_build_for_docs
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,8 +16,20 @@ custom_attribute:
|
||||
$ref: ./resource/custom_attribute.yml
|
||||
automation_rule:
|
||||
$ref: ./resource/automation_rule.yml
|
||||
automation_rule_item:
|
||||
$ref: ./resource/automation_rule_item.yml
|
||||
portal:
|
||||
$ref: ./resource/portal.yml
|
||||
portal_single:
|
||||
$ref: ./resource/portal_single.yml
|
||||
portal_config:
|
||||
$ref: ./resource/portal_config.yml
|
||||
portal_logo:
|
||||
$ref: ./resource/portal_logo.yml
|
||||
portal_meta:
|
||||
$ref: ./resource/portal_meta.yml
|
||||
portal_item:
|
||||
$ref: ./resource/portal_item.yml
|
||||
category:
|
||||
$ref: ./resource/category.yml
|
||||
article:
|
||||
@@ -34,6 +46,8 @@ agent:
|
||||
$ref: ./resource/agent.yml
|
||||
inbox:
|
||||
$ref: ./resource/inbox.yml
|
||||
inbox_contact:
|
||||
$ref: ./resource/inbox_contact.yml
|
||||
agent_bot:
|
||||
$ref: ./resource/agent_bot.yml
|
||||
contact_inboxes:
|
||||
@@ -173,7 +187,6 @@ contact_list:
|
||||
description: 'array of contacts'
|
||||
items:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/generic_id'
|
||||
- $ref: '#/components/schemas/contact'
|
||||
contact_conversations:
|
||||
type: array
|
||||
@@ -201,3 +214,28 @@ account_summary:
|
||||
$ref: './resource/reports/summary.yml'
|
||||
agent_conversation_metrics:
|
||||
$ref: './resource/reports/conversation/agent.yml'
|
||||
|
||||
contact_detail:
|
||||
$ref: ./resource/contact_detail.yml
|
||||
message_detailed:
|
||||
$ref: ./resource/message_detailed.yml
|
||||
conversation_meta:
|
||||
$ref: ./resource/conversation_meta.yml
|
||||
conversation_messages:
|
||||
$ref: ./resource/conversation_messages.yml
|
||||
contact_meta:
|
||||
$ref: ./resource/contact_meta.yml
|
||||
contact_inbox:
|
||||
$ref: ./resource/contact_inbox.yml
|
||||
contact_list_item:
|
||||
$ref: ./resource/contact_list_item.yml
|
||||
contacts_list_response:
|
||||
$ref: ./resource/contacts_list_response.yml
|
||||
contact_show_response:
|
||||
$ref: ./resource/contact_show_response.yml
|
||||
contact_conversation_message:
|
||||
$ref: ./resource/contact_conversation_message.yml
|
||||
contact_conversations_response:
|
||||
$ref: ./resource/contact_conversations_response.yml
|
||||
contactable_inboxes_response:
|
||||
$ref: ./resource/contactable_inboxes_response.yml
|
||||
|
||||
@@ -2,23 +2,8 @@ type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
uid:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
available_name:
|
||||
type: string
|
||||
display_name:
|
||||
type: string
|
||||
email:
|
||||
type: string
|
||||
account_id:
|
||||
type: integer
|
||||
role:
|
||||
type: string
|
||||
enum: ['agent', 'administrator']
|
||||
confirmed:
|
||||
type: boolean
|
||||
availability_status:
|
||||
type: string
|
||||
enum: ['available', 'busy', 'offline']
|
||||
@@ -26,6 +11,25 @@ properties:
|
||||
auto_offline:
|
||||
type: boolean
|
||||
description: Whether the availability status of agent is configured to go offline automatically when away.
|
||||
custom_attributes:
|
||||
type: object
|
||||
description: Available for users who are created through platform APIs and has custom attributes associated.
|
||||
confirmed:
|
||||
type: boolean
|
||||
description: Whether the agent has confirmed their email address.
|
||||
email:
|
||||
type: string
|
||||
description: The email of the agent
|
||||
available_name:
|
||||
type: string
|
||||
description: The available name of the agent
|
||||
name:
|
||||
type: string
|
||||
description: The name of the agent
|
||||
role:
|
||||
type: string
|
||||
enum: ['agent', 'administrator']
|
||||
description: The role of the agent
|
||||
thumbnail:
|
||||
type: string
|
||||
description: The thumbnail of the agent
|
||||
custom_role_id:
|
||||
type: integer
|
||||
description: The custom role id of the agent
|
||||
|
||||
@@ -9,9 +9,24 @@ properties:
|
||||
description:
|
||||
type: string
|
||||
description: The description about the agent bot
|
||||
account_id:
|
||||
type: number
|
||||
description: Account ID if it's an account specific bot
|
||||
thumbnail:
|
||||
type: string
|
||||
description: The thumbnail of the agent bot
|
||||
outgoing_url:
|
||||
type: string
|
||||
description: The webhook URL for the bot
|
||||
bot_type:
|
||||
type: string
|
||||
description: The type of the bot
|
||||
bot_config:
|
||||
type: object
|
||||
description: The configuration of the bot
|
||||
account_id:
|
||||
type: number
|
||||
description: Account ID if it's an account specific bot
|
||||
access_token:
|
||||
type: string
|
||||
description: The access token for the bot
|
||||
system_bot:
|
||||
type: boolean
|
||||
description: Whether the bot is a system bot
|
||||
|
||||
@@ -1,45 +1,13 @@
|
||||
type: object
|
||||
properties:
|
||||
event_name:
|
||||
type: string
|
||||
description: Automation Rule event, on which we call the actions(conversation_created, conversation_updated, message_created)
|
||||
enum:
|
||||
- conversation_created
|
||||
- conversation_updated
|
||||
- message_created
|
||||
example: message_created
|
||||
name:
|
||||
type: string
|
||||
description: The name of the rule
|
||||
example: Add label on message create event
|
||||
description:
|
||||
type: string
|
||||
description: Description to give more context about the rule
|
||||
example: Add label support and sales on message create event if incoming message content contains text help
|
||||
active:
|
||||
type: boolean
|
||||
description: Enable/disable automation rule
|
||||
actions:
|
||||
type: array
|
||||
description: Array of actions which we perform when condition matches
|
||||
items:
|
||||
type: object
|
||||
example:
|
||||
action_name: add_label
|
||||
action_params:
|
||||
- support
|
||||
- sales
|
||||
conditions:
|
||||
type: array
|
||||
description: Array of conditions on which conversation/message filter would work
|
||||
items:
|
||||
type: object
|
||||
example:
|
||||
attribute_key: content
|
||||
filter_operator: contains
|
||||
values:
|
||||
- help
|
||||
query_operator: nil
|
||||
account_id:
|
||||
type: integer
|
||||
description: Account Id
|
||||
payload:
|
||||
description: Response payload that contains automation rule(s)
|
||||
oneOf:
|
||||
- type: array
|
||||
description: Array of automation rules (for listing endpoint)
|
||||
items:
|
||||
$ref: '#/components/schemas/automation_rule_item'
|
||||
- type: object
|
||||
description: Single automation rule (for show/create/update endpoints)
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/automation_rule_item'
|
||||
69
swagger/definitions/resource/automation_rule_item.yml
Normal file
69
swagger/definitions/resource/automation_rule_item.yml
Normal file
@@ -0,0 +1,69 @@
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: The ID of the automation rule
|
||||
account_id:
|
||||
type: integer
|
||||
description: Account Id
|
||||
name:
|
||||
type: string
|
||||
description: The name of the rule
|
||||
example: Add label on message create event
|
||||
description:
|
||||
type: string
|
||||
description: Description to give more context about the rule
|
||||
example: Add label support and sales on message create event if incoming message content contains text help
|
||||
event_name:
|
||||
type: string
|
||||
description: Automation Rule event, on which we call the actions(conversation_created, conversation_updated, message_created)
|
||||
enum:
|
||||
- conversation_created
|
||||
- conversation_updated
|
||||
- message_created
|
||||
example: message_created
|
||||
conditions:
|
||||
type: array
|
||||
description: Array of conditions on which conversation/message filter would work
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
values:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
attribute_key:
|
||||
type: string
|
||||
query_operator:
|
||||
type: string
|
||||
filter_operator:
|
||||
type: string
|
||||
example:
|
||||
attribute_key: content
|
||||
filter_operator: contains
|
||||
values:
|
||||
- help
|
||||
query_operator: and
|
||||
actions:
|
||||
type: array
|
||||
description: Array of actions which we perform when condition matches
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
action_name:
|
||||
type: string
|
||||
action_params:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
example:
|
||||
action_name: add_label
|
||||
action_params:
|
||||
- support
|
||||
- sales
|
||||
created_on:
|
||||
type: integer
|
||||
description: The timestamp when the rule was created
|
||||
active:
|
||||
type: boolean
|
||||
description: Enable/disable automation rule
|
||||
@@ -3,12 +3,18 @@ properties:
|
||||
id:
|
||||
type: integer
|
||||
description: ID of the canned response
|
||||
content:
|
||||
type: string
|
||||
description: Message content for canned response
|
||||
short_code:
|
||||
type: string
|
||||
description: Short Code for quick access of the canned response
|
||||
account_id:
|
||||
type: integer
|
||||
description: Account Id
|
||||
short_code:
|
||||
type: string
|
||||
description: Short Code for quick access of the canned response
|
||||
content:
|
||||
type: string
|
||||
description: Message content for canned response
|
||||
created_at:
|
||||
type: string
|
||||
description: The date and time when the canned response was created
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date and time when the canned response was updated
|
||||
|
||||
@@ -1,32 +1,49 @@
|
||||
type: object
|
||||
properties:
|
||||
payload:
|
||||
type: object
|
||||
properties:
|
||||
contact:
|
||||
type: object
|
||||
properties:
|
||||
email:
|
||||
type: string
|
||||
description: Email address of the contact
|
||||
name:
|
||||
type: string
|
||||
description: The name of the contact
|
||||
phone_number:
|
||||
type: string
|
||||
description: Phone number of the contact
|
||||
thumbnail:
|
||||
type: string
|
||||
description: Avatar URL of the contact
|
||||
additional_attributes:
|
||||
type: object
|
||||
description: The object containing additional attributes related to the contact
|
||||
custom_attributes:
|
||||
type: object
|
||||
description: The object to save custom attributes for contact, accepts custom attributes key and value
|
||||
example:
|
||||
{ attribute_key: attribute_value, signed_up_at: dd/mm/yyyy }
|
||||
contact_inboxes:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/contact_inboxes'
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
additional_attributes:
|
||||
type: object
|
||||
description: The object containing additional attributes related to the contact
|
||||
availability_status:
|
||||
type: string
|
||||
description: The availability status of the contact
|
||||
email:
|
||||
type: string
|
||||
description: The email address of the contact
|
||||
id:
|
||||
type: integer
|
||||
description: The ID of the contact
|
||||
name:
|
||||
type: string
|
||||
description: The name of the contact
|
||||
phone_number:
|
||||
type: string
|
||||
description: The phone number of the contact
|
||||
blocked:
|
||||
type: boolean
|
||||
description: Whether the contact is blocked
|
||||
identifier:
|
||||
type: string
|
||||
description: The identifier of the contact
|
||||
thumbnail:
|
||||
type: string
|
||||
description: The thumbnail of the contact
|
||||
custom_attributes:
|
||||
type: object
|
||||
description: The custom attributes of the contact
|
||||
example:
|
||||
{ attribute_key: attribute_value, signed_up_at: dd/mm/yyyy }
|
||||
last_activity_at:
|
||||
type: integer
|
||||
description: The last activity at of the contact
|
||||
created_at:
|
||||
type: integer
|
||||
description: The created at of the contact
|
||||
contact_inboxes:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/contact_inboxes'
|
||||
|
||||
109
swagger/definitions/resource/contact_conversation_message.yml
Normal file
109
swagger/definitions/resource/contact_conversation_message.yml
Normal file
@@ -0,0 +1,109 @@
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: ID of the message
|
||||
content:
|
||||
type: string
|
||||
description: Content of the message
|
||||
account_id:
|
||||
type: integer
|
||||
description: ID of the account
|
||||
inbox_id:
|
||||
type: integer
|
||||
description: ID of the inbox
|
||||
conversation_id:
|
||||
type: integer
|
||||
description: ID of the conversation
|
||||
message_type:
|
||||
type: integer
|
||||
description: Type of the message
|
||||
created_at:
|
||||
type: integer
|
||||
description: Timestamp when message was created
|
||||
updated_at:
|
||||
type: string
|
||||
description: Formatted datetime when message was updated
|
||||
private:
|
||||
type: boolean
|
||||
description: Whether the message is private
|
||||
status:
|
||||
type: string
|
||||
description: Status of the message
|
||||
source_id:
|
||||
type: string
|
||||
description: Source ID of the message
|
||||
nullable: true
|
||||
content_type:
|
||||
type: string
|
||||
description: Type of the content
|
||||
content_attributes:
|
||||
type: object
|
||||
description: Attributes of the content
|
||||
sender_type:
|
||||
type: string
|
||||
description: Type of the sender
|
||||
nullable: true
|
||||
sender_id:
|
||||
type: integer
|
||||
description: ID of the sender
|
||||
nullable: true
|
||||
external_source_ids:
|
||||
type: object
|
||||
description: External source IDs
|
||||
additional_attributes:
|
||||
type: object
|
||||
description: Additional attributes of the message
|
||||
processed_message_content:
|
||||
type: string
|
||||
description: Processed message content
|
||||
nullable: true
|
||||
sentiment:
|
||||
type: object
|
||||
description: Sentiment analysis of the message
|
||||
conversation:
|
||||
type: object
|
||||
description: Conversation details
|
||||
properties:
|
||||
assignee_id:
|
||||
type: integer
|
||||
description: ID of the assignee
|
||||
nullable: true
|
||||
unread_count:
|
||||
type: integer
|
||||
description: Count of unread messages
|
||||
last_activity_at:
|
||||
type: integer
|
||||
description: Timestamp of last activity
|
||||
contact_inbox:
|
||||
type: object
|
||||
description: Contact inbox details
|
||||
properties:
|
||||
source_id:
|
||||
type: string
|
||||
description: Source ID of the contact inbox
|
||||
sender:
|
||||
type: object
|
||||
description: Details of the sender
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: ID of the sender
|
||||
name:
|
||||
type: string
|
||||
description: Name of the sender
|
||||
available_name:
|
||||
type: string
|
||||
description: Available name of the sender
|
||||
avatar_url:
|
||||
type: string
|
||||
description: URL of the sender's avatar
|
||||
type:
|
||||
type: string
|
||||
description: Type of the sender
|
||||
availability_status:
|
||||
type: string
|
||||
description: Availability status of the sender
|
||||
thumbnail:
|
||||
type: string
|
||||
description: Thumbnail URL of the sender
|
||||
@@ -0,0 +1,13 @@
|
||||
type: object
|
||||
properties:
|
||||
payload:
|
||||
type: array
|
||||
items:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/conversation'
|
||||
- type: object
|
||||
properties:
|
||||
meta:
|
||||
$ref: './extension/contact/conversation.yml#/properties/meta'
|
||||
description: Meta information about the conversation
|
||||
description: List of conversations for the contact
|
||||
48
swagger/definitions/resource/contact_detail.yml
Normal file
48
swagger/definitions/resource/contact_detail.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
type: object
|
||||
properties:
|
||||
additional_attributes:
|
||||
type: object
|
||||
description: The object containing additional attributes related to the contact
|
||||
properties:
|
||||
city:
|
||||
type: string
|
||||
description: City of the contact
|
||||
country:
|
||||
type: string
|
||||
description: Country of the contact
|
||||
country_code:
|
||||
type: string
|
||||
description: Country code of the contact
|
||||
created_at_ip:
|
||||
type: string
|
||||
description: IP address when the contact was created
|
||||
custom_attributes:
|
||||
type: object
|
||||
description: The custom attributes of the contact
|
||||
email:
|
||||
type: string
|
||||
description: The email address of the contact
|
||||
id:
|
||||
type: integer
|
||||
description: The ID of the contact
|
||||
identifier:
|
||||
type: string
|
||||
description: The identifier of the contact
|
||||
nullable: true
|
||||
name:
|
||||
type: string
|
||||
description: The name of the contact
|
||||
phone_number:
|
||||
type: string
|
||||
description: The phone number of the contact
|
||||
nullable: true
|
||||
thumbnail:
|
||||
type: string
|
||||
description: The thumbnail of the contact
|
||||
blocked:
|
||||
type: boolean
|
||||
description: Whether the contact is blocked
|
||||
type:
|
||||
type: string
|
||||
description: The type of entity
|
||||
enum: ["contact"]
|
||||
27
swagger/definitions/resource/contact_inbox.yml
Normal file
27
swagger/definitions/resource/contact_inbox.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
type: object
|
||||
properties:
|
||||
source_id:
|
||||
type: string
|
||||
description: Source identifier for the contact inbox
|
||||
inbox:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: ID of the inbox
|
||||
avatar_url:
|
||||
type: string
|
||||
description: URL for the inbox avatar
|
||||
channel_id:
|
||||
type: integer
|
||||
description: ID of the channel
|
||||
name:
|
||||
type: string
|
||||
description: Name of the inbox
|
||||
channel_type:
|
||||
type: string
|
||||
description: Type of channel
|
||||
provider:
|
||||
type: string
|
||||
description: Provider of the inbox
|
||||
nullable: true
|
||||
@@ -4,5 +4,4 @@ properties:
|
||||
type: string
|
||||
description: Contact Inbox Source Id
|
||||
inbox:
|
||||
type: object
|
||||
$ref: '#/components/schemas/inbox'
|
||||
$ref: '#/components/schemas/inbox_contact'
|
||||
|
||||
61
swagger/definitions/resource/contact_list_item.yml
Normal file
61
swagger/definitions/resource/contact_list_item.yml
Normal file
@@ -0,0 +1,61 @@
|
||||
type: object
|
||||
properties:
|
||||
additional_attributes:
|
||||
type: object
|
||||
description: The object containing additional attributes related to the contact
|
||||
properties:
|
||||
city:
|
||||
type: string
|
||||
description: City of the contact
|
||||
country:
|
||||
type: string
|
||||
description: Country of the contact
|
||||
country_code:
|
||||
type: string
|
||||
description: Country code of the contact
|
||||
created_at_ip:
|
||||
type: string
|
||||
description: IP address when the contact was created
|
||||
availability_status:
|
||||
type: string
|
||||
description: Availability status of the contact
|
||||
enum: ["online", "offline"]
|
||||
email:
|
||||
type: string
|
||||
description: The email address of the contact
|
||||
nullable: true
|
||||
id:
|
||||
type: integer
|
||||
description: The ID of the contact
|
||||
name:
|
||||
type: string
|
||||
description: The name of the contact
|
||||
phone_number:
|
||||
type: string
|
||||
description: The phone number of the contact
|
||||
nullable: true
|
||||
blocked:
|
||||
type: boolean
|
||||
description: Whether the contact is blocked
|
||||
identifier:
|
||||
type: string
|
||||
description: The identifier of the contact
|
||||
nullable: true
|
||||
thumbnail:
|
||||
type: string
|
||||
description: The thumbnail of the contact
|
||||
custom_attributes:
|
||||
type: object
|
||||
description: The custom attributes of the contact
|
||||
last_activity_at:
|
||||
type: integer
|
||||
description: Timestamp of last activity
|
||||
nullable: true
|
||||
created_at:
|
||||
type: integer
|
||||
description: Timestamp when contact was created
|
||||
contact_inboxes:
|
||||
type: array
|
||||
description: List of inboxes associated with this contact
|
||||
items:
|
||||
$ref: '#/components/schemas/contact_inbox'
|
||||
8
swagger/definitions/resource/contact_meta.yml
Normal file
8
swagger/definitions/resource/contact_meta.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
type: object
|
||||
properties:
|
||||
count:
|
||||
type: integer
|
||||
description: Total number of contacts
|
||||
current_page:
|
||||
type: string
|
||||
description: Current page number
|
||||
5
swagger/definitions/resource/contact_show_response.yml
Normal file
5
swagger/definitions/resource/contact_show_response.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
type: object
|
||||
properties:
|
||||
payload:
|
||||
$ref: '#/components/schemas/contact_list_item'
|
||||
description: Contact details
|
||||
@@ -0,0 +1,7 @@
|
||||
type: object
|
||||
properties:
|
||||
payload:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/contact_inbox'
|
||||
description: List of contactable inboxes for the contact
|
||||
10
swagger/definitions/resource/contacts_list_response.yml
Normal file
10
swagger/definitions/resource/contacts_list_response.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
type: object
|
||||
properties:
|
||||
meta:
|
||||
$ref: '#/components/schemas/contact_meta'
|
||||
description: Metadata about the contact list response
|
||||
payload:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/contact_list_item'
|
||||
description: List of contacts
|
||||
@@ -10,27 +10,82 @@ properties:
|
||||
account_id:
|
||||
type: number
|
||||
description: Account Id
|
||||
uuid:
|
||||
type: string
|
||||
description: UUID of the conversation
|
||||
additional_attributes:
|
||||
type: object
|
||||
description: The object containing additional attributes related to the conversation
|
||||
agent_last_seen_at:
|
||||
type: number
|
||||
description: The last activity at of the agent
|
||||
assignee_last_seen_at:
|
||||
type: number
|
||||
description: The last activity at of the assignee
|
||||
can_reply:
|
||||
type: boolean
|
||||
description: Whether the conversation can be replied to
|
||||
contact_last_seen_at:
|
||||
type: number
|
||||
description: The last activity at of the contact
|
||||
custom_attributes:
|
||||
type: object
|
||||
description: The object to save custom attributes for conversation, accepts custom attributes key and value
|
||||
inbox_id:
|
||||
type: number
|
||||
description: ID of the inbox
|
||||
labels:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: The labels of the conversation
|
||||
muted:
|
||||
type: boolean
|
||||
description: Whether the conversation is muted
|
||||
snoozed_until:
|
||||
type: number
|
||||
description: The time at which the conversation will be unmuted
|
||||
status:
|
||||
type: string
|
||||
enum: ['open', 'resolved', 'pending']
|
||||
description: The status of the conversation
|
||||
created_at:
|
||||
type: number
|
||||
description: The time at which conversation was created
|
||||
updated_at:
|
||||
type: number
|
||||
description: The time at which conversation was updated
|
||||
timestamp:
|
||||
type: string
|
||||
description: The time at which conversation was created
|
||||
contact_last_seen_at:
|
||||
type: string
|
||||
agent_last_seen_at:
|
||||
type: string
|
||||
first_reply_created_at:
|
||||
type: number
|
||||
description: The time at which the first reply was created
|
||||
unread_count:
|
||||
type: number
|
||||
description: The number of unread messages
|
||||
additional_attributes:
|
||||
last_non_activity_message:
|
||||
type: object
|
||||
description: The object containing additional attributes related to the conversation
|
||||
custom_attributes:
|
||||
$ref: '#/components/schemas/message'
|
||||
description: The last non activity message
|
||||
last_activity_at:
|
||||
type: number
|
||||
description: The last activity at of the conversation
|
||||
priority:
|
||||
type: string
|
||||
description: The priority of the conversation
|
||||
waiting_since:
|
||||
type: number
|
||||
description: The time at which the conversation was waiting
|
||||
sla_policy_id:
|
||||
type: number
|
||||
description: The ID of the SLA policy
|
||||
applied_sla:
|
||||
type: object
|
||||
description: The object to save custom attributes for conversation, accepts custom attributes key and value
|
||||
example: { attribute_key: attribute_value, priority_conversation_number: 3 }
|
||||
description: The applied SLA
|
||||
sla_events:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
description: SLA event objects
|
||||
|
||||
|
||||
10
swagger/definitions/resource/conversation_messages.yml
Normal file
10
swagger/definitions/resource/conversation_messages.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
type: object
|
||||
properties:
|
||||
meta:
|
||||
$ref: '#/components/schemas/conversation_meta'
|
||||
description: Meta information about the conversation
|
||||
payload:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/message_detailed'
|
||||
description: List of messages in the conversation
|
||||
55
swagger/definitions/resource/conversation_meta.yml
Normal file
55
swagger/definitions/resource/conversation_meta.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
type: object
|
||||
properties:
|
||||
labels:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Labels associated with the conversation
|
||||
additional_attributes:
|
||||
type: object
|
||||
properties:
|
||||
browser:
|
||||
type: object
|
||||
properties:
|
||||
device_name:
|
||||
type: string
|
||||
description: Name of the device
|
||||
browser_name:
|
||||
type: string
|
||||
description: Name of the browser
|
||||
platform_name:
|
||||
type: string
|
||||
description: Name of the platform
|
||||
browser_version:
|
||||
type: string
|
||||
description: Version of the browser
|
||||
platform_version:
|
||||
type: string
|
||||
description: Version of the platform
|
||||
referer:
|
||||
type: string
|
||||
description: Referrer URL
|
||||
initiated_at:
|
||||
type: object
|
||||
properties:
|
||||
timestamp:
|
||||
type: string
|
||||
description: Timestamp when the conversation was initiated
|
||||
browser_language:
|
||||
type: string
|
||||
description: Browser language setting
|
||||
conversation_language:
|
||||
type: string
|
||||
description: Conversation language
|
||||
description: Additional attributes of the conversation
|
||||
contact:
|
||||
$ref: '#/components/schemas/contact_detail'
|
||||
description: Contact details
|
||||
agent_last_seen_at:
|
||||
type: string
|
||||
description: Timestamp when the agent last saw the conversation
|
||||
nullable: true
|
||||
assignee_last_seen_at:
|
||||
type: string
|
||||
description: Timestamp when the assignee last saw the conversation
|
||||
nullable: true
|
||||
@@ -15,15 +15,24 @@ properties:
|
||||
attribute_key:
|
||||
type: string
|
||||
description: Attribute unique key value
|
||||
regex_pattern:
|
||||
type: string
|
||||
description: Regex pattern
|
||||
regex_cue:
|
||||
type: string
|
||||
description: Regex cue
|
||||
attribute_values:
|
||||
type: string
|
||||
description: Attribute values
|
||||
default_value:
|
||||
type: string
|
||||
description: Attribute default value
|
||||
attribute_model:
|
||||
type: string
|
||||
description: Attribute type(conversation_attribute/contact_attribute)
|
||||
account_id:
|
||||
type: integer
|
||||
description: Account Id
|
||||
default_value:
|
||||
type: string
|
||||
description: Attribute default value
|
||||
created_at:
|
||||
type: string
|
||||
description: The date and time when the custom attribute was created
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date and time when the custom attribute was updated
|
||||
|
||||
@@ -6,17 +6,48 @@ properties:
|
||||
sender:
|
||||
type: object
|
||||
properties:
|
||||
additional_attributes:
|
||||
type: object
|
||||
description: The additional attributes of the sender
|
||||
availability_status:
|
||||
type: string
|
||||
description: The availability status of the sender
|
||||
email:
|
||||
type: string
|
||||
description: The email of the sender
|
||||
id:
|
||||
type: number
|
||||
description: ID fo the sender
|
||||
name:
|
||||
type: string
|
||||
description: The name of the sender
|
||||
phone_number:
|
||||
type: string
|
||||
description: The phone number of the sender
|
||||
blocked:
|
||||
type: boolean
|
||||
description: Whether the sender is blocked
|
||||
identifier:
|
||||
type: string
|
||||
description: The identifier of the sender
|
||||
thumbnail:
|
||||
type: string
|
||||
description: Avatar URL of the contact
|
||||
channel:
|
||||
type: string
|
||||
description: Channel Type
|
||||
custom_attributes:
|
||||
type: object
|
||||
description: The custom attributes of the sender
|
||||
last_activity_at:
|
||||
type: number
|
||||
description: The last activity at of the sender
|
||||
created_at:
|
||||
type: number
|
||||
description: The created at of the sender
|
||||
|
||||
channel:
|
||||
type: string
|
||||
description: Channel Type
|
||||
assignee:
|
||||
$ref: '#/components/schemas/user'
|
||||
hmac_verified:
|
||||
type: boolean
|
||||
description: Whether the hmac is verified
|
||||
|
||||
@@ -39,3 +39,87 @@ properties:
|
||||
greeting_message:
|
||||
type: string
|
||||
description: A greeting message when the user starts the conversation
|
||||
channel_id:
|
||||
type: number
|
||||
description: ID of the channel this inbox belongs to
|
||||
working_hours_enabled:
|
||||
type: boolean
|
||||
description: The flag which shows whether working hours feature is enabled
|
||||
enable_email_collect:
|
||||
type: boolean
|
||||
description: The flag to enable collecting email from contacts
|
||||
csat_survey_enabled:
|
||||
type: boolean
|
||||
description: The flag to enable CSAT survey
|
||||
auto_assignment_config:
|
||||
type: object
|
||||
description: Configuration settings for auto assignment
|
||||
out_of_office_message:
|
||||
type: string
|
||||
description: Message to show when agents are out of office
|
||||
working_hours:
|
||||
type: array
|
||||
description: Configuration for working hours of the inbox
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
day_of_week:
|
||||
type: number
|
||||
description: Day of the week (0-6, where 0 is Sunday)
|
||||
closed_all_day:
|
||||
type: boolean
|
||||
description: Whether the inbox is closed for the entire day
|
||||
open_hour:
|
||||
type: number
|
||||
description: Hour when inbox opens (0-23)
|
||||
open_minutes:
|
||||
type: number
|
||||
description: Minutes of the hour when inbox opens (0-59)
|
||||
close_hour:
|
||||
type: number
|
||||
description: Hour when inbox closes (0-23)
|
||||
close_minutes:
|
||||
type: number
|
||||
description: Minutes of the hour when inbox closes (0-59)
|
||||
open_all_day:
|
||||
type: boolean
|
||||
description: Whether the inbox is open for the entire day
|
||||
timezone:
|
||||
type: string
|
||||
description: Timezone configuration for the inbox
|
||||
callback_webhook_url:
|
||||
type: string
|
||||
description: Webhook URL for callbacks
|
||||
allow_messages_after_resolved:
|
||||
type: boolean
|
||||
description: Whether to allow messages after a conversation is resolved
|
||||
lock_to_single_conversation:
|
||||
type: boolean
|
||||
description: Whether to lock a contact to a single conversation
|
||||
sender_name_type:
|
||||
type: string
|
||||
description: Type of sender name to display (e.g., friendly)
|
||||
business_name:
|
||||
type: string
|
||||
description: Business name associated with the inbox
|
||||
hmac_mandatory:
|
||||
type: boolean
|
||||
description: Whether HMAC verification is mandatory
|
||||
selected_feature_flags:
|
||||
type: object
|
||||
description: Selected feature flags for the inbox
|
||||
reply_time:
|
||||
type: string
|
||||
description: Expected reply time
|
||||
messaging_service_sid:
|
||||
type: string
|
||||
description: Messaging service SID for SMS providers
|
||||
phone_number:
|
||||
type: string
|
||||
description: Phone number associated with the inbox
|
||||
medium:
|
||||
type: string
|
||||
description: Medium of communication (e.g., sms, email)
|
||||
provider:
|
||||
type: string
|
||||
description: Provider of the channel
|
||||
|
||||
20
swagger/definitions/resource/inbox_contact.yml
Normal file
20
swagger/definitions/resource/inbox_contact.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: number
|
||||
description: ID of the inbox
|
||||
avatar_url:
|
||||
type: string
|
||||
description: The avatar image of the inbox
|
||||
channel_id:
|
||||
type: number
|
||||
description: The ID of the channel
|
||||
name:
|
||||
type: string
|
||||
description: The name of the inbox
|
||||
channel_type:
|
||||
type: string
|
||||
description: The type of the inbox
|
||||
provider:
|
||||
type: string
|
||||
description: The provider of the inbox
|
||||
@@ -1,8 +1,40 @@
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: number
|
||||
description: The ID of the message
|
||||
content:
|
||||
type: string
|
||||
description: The text content of the message
|
||||
account_id:
|
||||
type: number
|
||||
description: The ID of the account
|
||||
inbox_id:
|
||||
type: number
|
||||
description: The ID of the inbox
|
||||
conversation_id:
|
||||
type: number
|
||||
description: The ID of the conversation
|
||||
message_type:
|
||||
type: integer
|
||||
enum: [0, 1, 2]
|
||||
description: The type of the message
|
||||
created_at:
|
||||
type: integer
|
||||
description: The time at which message was created
|
||||
updated_at:
|
||||
type: integer
|
||||
description: The time at which message was updated
|
||||
private:
|
||||
type: boolean
|
||||
description: The flags which shows whether the message is private or not
|
||||
status:
|
||||
type: string
|
||||
enum: ["sent", "delivered", "read", "failed"]
|
||||
description: The status of the message
|
||||
source_id:
|
||||
type: string
|
||||
description: The source ID of the message
|
||||
content_type:
|
||||
type: string
|
||||
enum: ["text", "input_select", "cards", "form"]
|
||||
@@ -10,22 +42,31 @@ properties:
|
||||
content_attributes:
|
||||
type: object
|
||||
description: The content attributes for each content_type
|
||||
message_type:
|
||||
sender_type:
|
||||
type: string
|
||||
enum: ["incoming", "outgoing", "activity", "template"]
|
||||
description: The type of the message
|
||||
created_at:
|
||||
type: integer
|
||||
description: The time at which message was created
|
||||
private:
|
||||
type: boolean
|
||||
description: The flags which shows whether the message is private or not
|
||||
enum: ["contact", "agent", "agent_bot"]
|
||||
description: The type of the sender
|
||||
sender_id:
|
||||
type: number
|
||||
description: The ID of the sender
|
||||
external_source_ids:
|
||||
type: object
|
||||
description: The external source IDs of the message
|
||||
additional_attributes:
|
||||
type: object
|
||||
description: The additional attributes of the message
|
||||
processed_message_content:
|
||||
type: string
|
||||
description: The processed message content
|
||||
sentiment:
|
||||
type: object
|
||||
description: The sentiment of the message
|
||||
conversation:
|
||||
type: object
|
||||
description: The conversation object
|
||||
attachment:
|
||||
type: object
|
||||
description: The file object attached to the image
|
||||
sender:
|
||||
type: object
|
||||
description: User/Agent/AgentBot object
|
||||
conversation_id:
|
||||
type: number
|
||||
description: ID of the conversation
|
||||
|
||||
47
swagger/definitions/resource/message_detailed.yml
Normal file
47
swagger/definitions/resource/message_detailed.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: number
|
||||
description: The ID of the message
|
||||
content:
|
||||
type: string
|
||||
description: The text content of the message
|
||||
inbox_id:
|
||||
type: number
|
||||
description: The ID of the inbox
|
||||
conversation_id:
|
||||
type: number
|
||||
description: The ID of the conversation
|
||||
message_type:
|
||||
type: integer
|
||||
enum: [0, 1, 2, 3]
|
||||
description: "The type of the message (0: incoming, 1: outgoing, 2: activity, 3: template)"
|
||||
content_type:
|
||||
type: string
|
||||
enum: ["text", "input_select", "cards", "form", "input_csat"]
|
||||
description: The type of the message content
|
||||
status:
|
||||
type: string
|
||||
enum: ["sent", "delivered", "read", "failed"]
|
||||
description: The status of the message
|
||||
content_attributes:
|
||||
type: object
|
||||
description: The content attributes for each content_type
|
||||
properties:
|
||||
in_reply_to:
|
||||
type: string
|
||||
description: ID of the message this is replying to
|
||||
nullable: true
|
||||
created_at:
|
||||
type: integer
|
||||
description: The timestamp when message was created
|
||||
private:
|
||||
type: boolean
|
||||
description: The flag which shows whether the message is private or not
|
||||
source_id:
|
||||
type: string
|
||||
description: The source ID of the message
|
||||
nullable: true
|
||||
sender:
|
||||
$ref: '#/components/schemas/contact_detail'
|
||||
description: The sender of the message (only for incoming messages)
|
||||
@@ -1,34 +1,6 @@
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
archived:
|
||||
type: boolean
|
||||
color:
|
||||
type: string
|
||||
config:
|
||||
type: object
|
||||
description: Save information about locales, allowed_locales and default portal/help-center locale
|
||||
custom_domain:
|
||||
type: string
|
||||
header_text:
|
||||
type: string
|
||||
description: The text content.
|
||||
homepage_link:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
slug:
|
||||
type: string
|
||||
page_title:
|
||||
type: string
|
||||
account_id:
|
||||
type: integer
|
||||
categories:
|
||||
payload:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/category'
|
||||
articles:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/article'
|
||||
$ref: '#/components/schemas/portal_item'
|
||||
|
||||
18
swagger/definitions/resource/portal_config.yml
Normal file
18
swagger/definitions/resource/portal_config.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
type: object
|
||||
description: Configuration settings for the portal
|
||||
properties:
|
||||
allowed_locales:
|
||||
type: array
|
||||
description: List of allowed locales for the portal
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
code:
|
||||
type: string
|
||||
description: The language code
|
||||
articles_count:
|
||||
type: integer
|
||||
description: Number of articles in this locale
|
||||
categories_count:
|
||||
type: integer
|
||||
description: Number of categories in this locale
|
||||
40
swagger/definitions/resource/portal_item.yml
Normal file
40
swagger/definitions/resource/portal_item.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: The ID of the portal
|
||||
archived:
|
||||
type: boolean
|
||||
description: Whether the portal is archived
|
||||
color:
|
||||
type: string
|
||||
description: The color code for the portal
|
||||
config:
|
||||
$ref: '#/components/schemas/portal_config'
|
||||
custom_domain:
|
||||
type: string
|
||||
description: Custom domain for the portal
|
||||
header_text:
|
||||
type: string
|
||||
description: The header text for the portal
|
||||
homepage_link:
|
||||
type: string
|
||||
description: Homepage link for the portal
|
||||
name:
|
||||
type: string
|
||||
description: Name of the portal
|
||||
slug:
|
||||
type: string
|
||||
description: URL slug for the portal
|
||||
page_title:
|
||||
type: string
|
||||
description: Page title for the portal
|
||||
account_id:
|
||||
type: integer
|
||||
description: ID of the account the portal belongs to
|
||||
inbox:
|
||||
$ref: '#/components/schemas/inbox'
|
||||
logo:
|
||||
$ref: '#/components/schemas/portal_logo'
|
||||
meta:
|
||||
$ref: '#/components/schemas/portal_meta'
|
||||
23
swagger/definitions/resource/portal_logo.yml
Normal file
23
swagger/definitions/resource/portal_logo.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: ID of the logo file
|
||||
portal_id:
|
||||
type: integer
|
||||
description: ID of the portal this logo belongs to
|
||||
file_type:
|
||||
type: string
|
||||
description: MIME type of the file
|
||||
account_id:
|
||||
type: integer
|
||||
description: ID of the account
|
||||
file_url:
|
||||
type: string
|
||||
description: URL to access the logo file
|
||||
blob_id:
|
||||
type: integer
|
||||
description: ID of the blob
|
||||
filename:
|
||||
type: string
|
||||
description: Name of the file
|
||||
23
swagger/definitions/resource/portal_meta.yml
Normal file
23
swagger/definitions/resource/portal_meta.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
type: object
|
||||
properties:
|
||||
all_articles_count:
|
||||
type: integer
|
||||
description: Total number of articles
|
||||
archived_articles_count:
|
||||
type: integer
|
||||
nullable: true
|
||||
description: Number of archived articles
|
||||
published_count:
|
||||
type: integer
|
||||
nullable: true
|
||||
description: Number of published articles
|
||||
draft_articles_count:
|
||||
type: integer
|
||||
nullable: true
|
||||
description: Number of draft articles
|
||||
categories_count:
|
||||
type: integer
|
||||
description: Number of categories
|
||||
default_locale:
|
||||
type: string
|
||||
description: Default locale for the portal
|
||||
5
swagger/definitions/resource/portal_single.yml
Normal file
5
swagger/definitions/resource/portal_single.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
type: object
|
||||
properties:
|
||||
payload:
|
||||
description: A single portal object (for show/update endpoints)
|
||||
$ref: '#/components/schemas/portal_item'
|
||||
@@ -2,27 +2,77 @@ type: object
|
||||
properties:
|
||||
id:
|
||||
type: number
|
||||
uid:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
available_name:
|
||||
type: string
|
||||
display_name:
|
||||
type: string
|
||||
email:
|
||||
access_token:
|
||||
type: string
|
||||
account_id:
|
||||
type: number
|
||||
available_name:
|
||||
type: string
|
||||
avatar_url:
|
||||
type: string
|
||||
confirmed:
|
||||
type: boolean
|
||||
display_name:
|
||||
type: string
|
||||
nullable: true
|
||||
message_signature:
|
||||
type: string
|
||||
nullable: true
|
||||
email:
|
||||
type: string
|
||||
hmac_identifier:
|
||||
type: string
|
||||
inviter_id:
|
||||
type: number
|
||||
name:
|
||||
type: string
|
||||
provider:
|
||||
type: string
|
||||
pubsub_token:
|
||||
type: string
|
||||
role:
|
||||
type: string
|
||||
enum: ['agent', 'administrator']
|
||||
confirmed:
|
||||
type: boolean
|
||||
ui_settings:
|
||||
type: object
|
||||
uid:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
nullable: true
|
||||
custom_attributes:
|
||||
type: object
|
||||
description: Available for users who are created through platform APIs and has custom attributes associated.
|
||||
accounts:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/account'
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: number
|
||||
name:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
active_at:
|
||||
type: string
|
||||
format: date-time
|
||||
role:
|
||||
type: string
|
||||
enum: ['administrator', 'agent']
|
||||
permissions:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
availability:
|
||||
type: string
|
||||
availability_status:
|
||||
type: string
|
||||
auto_offline:
|
||||
type: boolean
|
||||
custom_role_id:
|
||||
type: number
|
||||
nullable: true
|
||||
custom_role:
|
||||
type: object
|
||||
nullable: true
|
||||
|
||||
@@ -34,7 +34,61 @@ components:
|
||||
in: header
|
||||
name: api_access_token
|
||||
description: This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles.
|
||||
|
||||
tags:
|
||||
- name: Accounts
|
||||
description: Account management APIs
|
||||
- name: Account Users
|
||||
description: Account user management APIs
|
||||
- name: AgentBots
|
||||
description: Bot integrations
|
||||
- name: Users
|
||||
description: User management APIs
|
||||
- name: Account AgentBots
|
||||
description: Account-specific Agent Bots
|
||||
- name: Agents
|
||||
description: Agent management APIs
|
||||
- name: Canned Responses
|
||||
description: Pre-defined responses for common queries
|
||||
- name: Contacts
|
||||
description: Contact management APIs
|
||||
- name: Contact Labels
|
||||
description: Manage contact labels
|
||||
- name: Conversation Assignments
|
||||
description: Manage conversation assignments
|
||||
- name: Conversation Labels
|
||||
description: Manage conversation labels
|
||||
- name: Conversations
|
||||
description: Conversation management APIs
|
||||
- name: Custom Attributes
|
||||
description: Custom fields for contacts and conversations
|
||||
- name: Custom Filters
|
||||
description: Saved filters for conversations
|
||||
- name: Inboxes
|
||||
description: Communication channels setup
|
||||
- name: Integrations
|
||||
description: Third-party integrations
|
||||
- name: Messages
|
||||
description: Message management APIs
|
||||
- name: Profile
|
||||
description: User profile APIs
|
||||
- name: Reports
|
||||
description: Analytics and reporting APIs
|
||||
- name: Teams
|
||||
description: Team management APIs
|
||||
- name: Webhooks
|
||||
description: Event notification webhooks
|
||||
- name: Automation Rule
|
||||
description: Workflow automation rules
|
||||
- name: Help Center
|
||||
description: Knowledge base management
|
||||
- name: Contacts API
|
||||
description: Public contact APIs
|
||||
- name: Conversations API
|
||||
description: Public conversation APIs
|
||||
- name: Messages API
|
||||
description: Public message APIs
|
||||
- name: CSAT Survey Page
|
||||
description: Customer satisfaction survey
|
||||
x-tagGroups:
|
||||
- name: Platform
|
||||
tags:
|
||||
@@ -48,6 +102,9 @@ x-tagGroups:
|
||||
- Agents
|
||||
- Canned Responses
|
||||
- Contacts
|
||||
- Contact Labels
|
||||
- Conversation Assignments
|
||||
- Conversation Labels
|
||||
- Conversations
|
||||
- Custom Attributes
|
||||
- Custom Filters
|
||||
|
||||
@@ -14,10 +14,7 @@ responses:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
description: Array of all automation rules
|
||||
items:
|
||||
$ref: '#/components/schemas/automation_rule'
|
||||
$ref: '#/components/schemas/automation_rule'
|
||||
'403':
|
||||
description: Access denied
|
||||
content:
|
||||
|
||||
@@ -19,6 +19,26 @@ responses:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/automation_rule'
|
||||
example:
|
||||
payload:
|
||||
id: 90
|
||||
account_id: 1
|
||||
name: "add-label-bug-if-message-contains-bug"
|
||||
description: "add-label-bug-if-message-contains-bug"
|
||||
event_name: "message_created"
|
||||
conditions:
|
||||
- values: ["incoming"]
|
||||
attribute_key: "message_type"
|
||||
query_operator: "and"
|
||||
filter_operator: "equal_to"
|
||||
- values: ["bug"]
|
||||
attribute_key: "content"
|
||||
filter_operator: "contains"
|
||||
actions:
|
||||
- action_name: "add_label"
|
||||
action_params: ["bugs", "support-query"]
|
||||
created_on: 1650555440
|
||||
active: true
|
||||
'401':
|
||||
description: Unauthorized
|
||||
content:
|
||||
|
||||
@@ -20,7 +20,7 @@ get:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/contactable_inboxes'
|
||||
$ref: '#/components/schemas/contactable_inboxes_response'
|
||||
'401':
|
||||
description: Authentication error
|
||||
content:
|
||||
|
||||
@@ -28,7 +28,7 @@ get:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/contact_conversations'
|
||||
$ref: '#/components/schemas/contact_conversations_response'
|
||||
'404':
|
||||
description: Contact not found
|
||||
content:
|
||||
|
||||
@@ -21,7 +21,7 @@ get:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/extended_contact'
|
||||
$ref: '#/components/schemas/contact_show_response'
|
||||
'404':
|
||||
description: Contact not found
|
||||
content:
|
||||
|
||||
@@ -55,7 +55,7 @@ post:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/contact_list'
|
||||
$ref: '#/components/schemas/contacts_list_response'
|
||||
'400':
|
||||
description: Bad Request Error
|
||||
content:
|
||||
|
||||
@@ -9,7 +9,7 @@ parameters:
|
||||
|
||||
get:
|
||||
tags:
|
||||
- Contacts
|
||||
- Contact Labels
|
||||
operationId: list-all-labels-of-a-contact
|
||||
summary: List Labels
|
||||
description: Lists all the labels of a contact
|
||||
@@ -37,7 +37,7 @@ get:
|
||||
|
||||
post:
|
||||
tags:
|
||||
- Contacts
|
||||
- Contact Labels
|
||||
operationId: contact-add-labels
|
||||
summary: Add Labels
|
||||
description: Add labels to a contact. Note that this API would overwrite the existing list of labels associated to the conversation.
|
||||
|
||||
@@ -16,7 +16,7 @@ get:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/contact_list'
|
||||
$ref: '#/components/schemas/contacts_list_response'
|
||||
'400':
|
||||
description: Bad Request Error
|
||||
content:
|
||||
|
||||
@@ -21,10 +21,7 @@ get:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
payload:
|
||||
$ref: '#/components/schemas/contact_list'
|
||||
$ref: '#/components/schemas/contacts_list_response'
|
||||
'401':
|
||||
description: Authentication error
|
||||
content:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tags:
|
||||
- Conversations
|
||||
- Conversation Assignments
|
||||
operationId: assign-a-conversation
|
||||
summary: Assign Conversation
|
||||
description: Assign a conversation to an agent or a team
|
||||
|
||||
@@ -11,12 +11,32 @@ responses:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
description: Array of messages
|
||||
items:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/generic_id'
|
||||
- $ref: '#/components/schemas/message'
|
||||
type: object
|
||||
properties:
|
||||
meta:
|
||||
type: object
|
||||
properties:
|
||||
labels:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
additional_attributes:
|
||||
type: object
|
||||
contact:
|
||||
$ref: '#/components/schemas/contact'
|
||||
assignee:
|
||||
$ref: '#/components/schemas/agent'
|
||||
agent_last_seen_at:
|
||||
type: string
|
||||
format: date-time
|
||||
assignee_last_seen_at:
|
||||
type: string
|
||||
format: date-time
|
||||
payload:
|
||||
type: array
|
||||
description: Array of messages
|
||||
items:
|
||||
$ref: '#/components/schemas/message'
|
||||
'404':
|
||||
description: Conversation not found
|
||||
content:
|
||||
|
||||
@@ -31,10 +31,13 @@ responses:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
description: 'Array of all active agents'
|
||||
items:
|
||||
$ref: '#/components/schemas/agent'
|
||||
type: object
|
||||
properties:
|
||||
payload:
|
||||
type: array
|
||||
description: 'Array of all active agents'
|
||||
items:
|
||||
$ref: '#/components/schemas/agent'
|
||||
'404':
|
||||
description: Inbox not found
|
||||
content:
|
||||
|
||||
@@ -13,10 +13,13 @@ responses:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
description: 'Array of all active agents'
|
||||
items:
|
||||
$ref: '#/components/schemas/agent'
|
||||
type: object
|
||||
properties:
|
||||
payload:
|
||||
type: array
|
||||
description: 'Array of all active agents'
|
||||
items:
|
||||
$ref: '#/components/schemas/agent'
|
||||
'404':
|
||||
description: Inbox not found
|
||||
content:
|
||||
|
||||
@@ -31,10 +31,13 @@ responses:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
description: 'Array of all active agents'
|
||||
items:
|
||||
$ref: '#/components/schemas/agent'
|
||||
type: object
|
||||
properties:
|
||||
payload:
|
||||
type: array
|
||||
description: 'Array of all active agents'
|
||||
items:
|
||||
$ref: '#/components/schemas/agent'
|
||||
'404':
|
||||
description: Inbox not found
|
||||
content:
|
||||
|
||||
@@ -14,10 +14,13 @@ get:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
description: 'Array of inboxes'
|
||||
items:
|
||||
$ref: '#/components/schemas/inbox'
|
||||
type: object
|
||||
properties:
|
||||
payload:
|
||||
type: array
|
||||
description: 'Array of inboxes'
|
||||
items:
|
||||
$ref: '#/components/schemas/inbox'
|
||||
'404':
|
||||
description: Inbox not found
|
||||
content:
|
||||
|
||||
@@ -11,10 +11,13 @@ responses:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
description: 'Array of Integration apps'
|
||||
items:
|
||||
$ref: '#/components/schemas/integrations_app'
|
||||
type: object
|
||||
properties:
|
||||
payload:
|
||||
type: array
|
||||
description: 'Array of Integration apps'
|
||||
items:
|
||||
$ref: '#/components/schemas/integrations_app'
|
||||
'401':
|
||||
description: Unauthorized
|
||||
content:
|
||||
|
||||
@@ -13,10 +13,45 @@ responses:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
description: Array of all portals
|
||||
items:
|
||||
$ref: '#/components/schemas/portal'
|
||||
$ref: '#/components/schemas/portal'
|
||||
example:
|
||||
payload:
|
||||
- id: 4
|
||||
color: "#1F93FF"
|
||||
custom_domain: "chatwoot.help"
|
||||
header_text: "Handbook"
|
||||
homepage_link: "https://www.chatwoot.com"
|
||||
name: "Handbook"
|
||||
page_title: "Handbook"
|
||||
slug: "handbook"
|
||||
archived: false
|
||||
account_id: 1
|
||||
config:
|
||||
allowed_locales:
|
||||
- code: "en"
|
||||
articles_count: 32
|
||||
categories_count: 9
|
||||
inbox:
|
||||
id: 37
|
||||
avatar_url: "https://example.com/avatar.png"
|
||||
channel_id: 1
|
||||
name: "Chatwoot"
|
||||
channel_type: "Channel::WebWidget"
|
||||
greeting_enabled: true
|
||||
widget_color: "#1F93FF"
|
||||
website_url: "chatwoot.com"
|
||||
logo:
|
||||
id: 19399916
|
||||
portal_id: 4
|
||||
file_type: "image/png"
|
||||
account_id: 1
|
||||
file_url: "https://example.com/logo.png"
|
||||
blob_id: 21239614
|
||||
filename: "square.png"
|
||||
meta:
|
||||
all_articles_count: 0
|
||||
categories_count: 9
|
||||
default_locale: "en"
|
||||
'403':
|
||||
description: Access denied
|
||||
content:
|
||||
|
||||
79
swagger/paths/application/portal/show.yml
Normal file
79
swagger/paths/application/portal/show.yml
Normal file
@@ -0,0 +1,79 @@
|
||||
tags:
|
||||
- Help Center
|
||||
operationId: get-details-of-a-single-portal
|
||||
summary: Get a portal details
|
||||
description: Get the details of a portal in the account
|
||||
security:
|
||||
- userApiKey: []
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/account_id'
|
||||
- $ref: '#/components/parameters/portal_id'
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/portal_single'
|
||||
example:
|
||||
payload:
|
||||
id: 123
|
||||
archived: false
|
||||
color: "#1F93FF"
|
||||
config:
|
||||
allowed_locales:
|
||||
- code: "en"
|
||||
articles_count: 32
|
||||
categories_count: 9
|
||||
custom_domain: "chatwoot.help"
|
||||
header_text: "Handbook"
|
||||
homepage_link: "https://www.chatwoot.com"
|
||||
name: "Handbook"
|
||||
slug: "handbook"
|
||||
page_title: "Handbook"
|
||||
account_id: 123
|
||||
inbox:
|
||||
id: 123
|
||||
name: "Chatwoot"
|
||||
website_url: "chatwoot.com"
|
||||
channel_type: "Channel::WebWidget"
|
||||
avatar_url: "https://example.com/avatar.png"
|
||||
widget_color: "#1F93FF"
|
||||
website_token: "4cWzuf9i9jxN9tbnv8K9STKU"
|
||||
enable_auto_assignment: true
|
||||
web_widget_script: "<script>...</script>"
|
||||
welcome_title: "Hi there ! 🙌🏼"
|
||||
welcome_tagline: "We make it simple to connect with us."
|
||||
greeting_enabled: true
|
||||
greeting_message: "Hey there 👋, Thank you for reaching out to us."
|
||||
channel_id: 123
|
||||
working_hours_enabled: true
|
||||
enable_email_collect: true
|
||||
csat_survey_enabled: true
|
||||
timezone: "America/Los_Angeles"
|
||||
business_name: "Chatwoot"
|
||||
hmac_mandatory: true
|
||||
logo:
|
||||
id: 123
|
||||
portal_id: 123
|
||||
file_type: "image/png"
|
||||
account_id: 123
|
||||
file_url: "https://example.com/logo.png"
|
||||
blob_id: 123
|
||||
filename: "square.png"
|
||||
meta:
|
||||
all_articles_count: 32
|
||||
categories_count: 9
|
||||
default_locale: "en"
|
||||
'401':
|
||||
description: Unauthorized
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/bad_request_error'
|
||||
'404':
|
||||
description: The given portal ID does not exist in the account
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/bad_request_error'
|
||||
@@ -5,6 +5,9 @@ summary: Update a portal
|
||||
description: Update a portal to account
|
||||
security:
|
||||
- userApiKey: []
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/account_id'
|
||||
- $ref: '#/components/parameters/portal_id'
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
@@ -17,10 +20,66 @@ responses:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/portal'
|
||||
$ref: '#/components/schemas/portal_single'
|
||||
example:
|
||||
payload:
|
||||
id: 123
|
||||
archived: false
|
||||
color: "#1F93FF"
|
||||
config:
|
||||
allowed_locales:
|
||||
- code: "en"
|
||||
articles_count: 32
|
||||
categories_count: 9
|
||||
custom_domain: "chatwoot.help"
|
||||
header_text: "Handbook"
|
||||
homepage_link: "https://www.chatwoot.com"
|
||||
name: "Handbook"
|
||||
slug: "handbook"
|
||||
page_title: "Handbook"
|
||||
account_id: 123
|
||||
inbox:
|
||||
id: 123
|
||||
name: "Chatwoot"
|
||||
website_url: "chatwoot.com"
|
||||
channel_type: "Channel::WebWidget"
|
||||
avatar_url: "https://example.com/avatar.png"
|
||||
widget_color: "#1F93FF"
|
||||
website_token: "4cWzuf9i9jxN9tbnv8K9STKU"
|
||||
enable_auto_assignment: true
|
||||
web_widget_script: "<script>...</script>"
|
||||
welcome_title: "Hi there ! 🙌🏼"
|
||||
welcome_tagline: "We make it simple to connect with us."
|
||||
greeting_enabled: true
|
||||
greeting_message: "Hey there 👋, Thank you for reaching out to us."
|
||||
channel_id: 123
|
||||
working_hours_enabled: true
|
||||
enable_email_collect: true
|
||||
csat_survey_enabled: true
|
||||
timezone: "America/Los_Angeles"
|
||||
business_name: "Chatwoot"
|
||||
hmac_mandatory: true
|
||||
logo:
|
||||
id: 123
|
||||
portal_id: 123
|
||||
file_type: "image/png"
|
||||
account_id: 123
|
||||
file_url: "https://example.com/logo.png"
|
||||
blob_id: 123
|
||||
filename: "square.png"
|
||||
meta:
|
||||
all_articles_count: 32
|
||||
categories_count: 9
|
||||
default_locale: "en"
|
||||
'403':
|
||||
description: Access denied
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/bad_request_error'
|
||||
'404':
|
||||
description: Portal not found
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/bad_request_error'
|
||||
|
||||
@@ -63,11 +63,6 @@
|
||||
- $ref: '#/components/parameters/platform_user_id'
|
||||
get:
|
||||
$ref: './platform/users/login.yml'
|
||||
/platform/api/v1/users/{id}/token:
|
||||
parameters:
|
||||
- $ref: '#/parameters/platform_user_id'
|
||||
post:
|
||||
$ref: './platform/users/token.yml'
|
||||
|
||||
# ---------------- end of platform path -----------#
|
||||
|
||||
@@ -605,3 +600,27 @@
|
||||
description: The numeric ID of the user
|
||||
get:
|
||||
$ref: './application/reports/conversation/agent.yml'
|
||||
|
||||
# Conversations Messages
|
||||
/accounts/{account_id}/conversations/{conversation_id}/messages:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/account_id'
|
||||
- name: conversation_id
|
||||
in: path
|
||||
description: ID of the conversation
|
||||
required: true
|
||||
schema:
|
||||
type: number
|
||||
get:
|
||||
tags:
|
||||
- Conversation
|
||||
summary: Get messages from a conversation
|
||||
description: Returns all messages from a specific conversation
|
||||
operationId: getConversationMessages
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/conversation_messages'
|
||||
|
||||
2268
swagger/swagger.json
2268
swagger/swagger.json
File diff suppressed because it is too large
Load Diff
65
swagger/tag_groups/application.yml
Normal file
65
swagger/tag_groups/application.yml
Normal file
@@ -0,0 +1,65 @@
|
||||
openapi: '3.0.4'
|
||||
info:
|
||||
title: Chatwoot - Application API
|
||||
description: Application API endpoints for Chatwoot
|
||||
version: 1.1.0
|
||||
termsOfService: https://www.chatwoot.com/terms-of-service/
|
||||
contact:
|
||||
email: hello@chatwoot.com
|
||||
license:
|
||||
name: MIT License
|
||||
url: https://opensource.org/licenses/MIT
|
||||
servers:
|
||||
- url: https://app.chatwoot.com/
|
||||
tags:
|
||||
- name: Account AgentBots
|
||||
description: Manage agent bots within accounts
|
||||
- name: Agents
|
||||
description: Manage agents
|
||||
- name: Canned Responses
|
||||
description: Manage canned responses
|
||||
- name: Contacts
|
||||
description: Manage contacts
|
||||
- name: Contact Labels
|
||||
description: Manage contact labels
|
||||
- name: Conversation Assignments
|
||||
description: Manage conversation assignments
|
||||
- name: Conversation Labels
|
||||
description: Manage conversation labels
|
||||
- name: Conversations
|
||||
description: Manage conversations
|
||||
- name: Custom Attributes
|
||||
description: Manage custom attributes
|
||||
- name: Custom Filters
|
||||
description: Manage custom filters
|
||||
- name: Inboxes
|
||||
description: Manage inboxes
|
||||
- name: Integrations
|
||||
description: Manage integrations
|
||||
- name: Messages
|
||||
description: Manage messages
|
||||
- name: Profile
|
||||
description: Manage user profile
|
||||
- name: Reports
|
||||
description: Generate reports
|
||||
- name: Teams
|
||||
description: Manage teams
|
||||
- name: Webhooks
|
||||
description: Manage webhooks
|
||||
- name: Automation Rule
|
||||
description: Manage automation rules
|
||||
- name: Help Center
|
||||
description: Manage help center
|
||||
paths:
|
||||
$ref: ../paths/index.yml
|
||||
components:
|
||||
schemas:
|
||||
$ref: ../definitions/index.yml
|
||||
parameters:
|
||||
$ref: ../parameters/index.yml
|
||||
securitySchemes:
|
||||
userApiKey:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: api_access_token
|
||||
description: This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels.
|
||||
10184
swagger/tag_groups/application_swagger.json
Normal file
10184
swagger/tag_groups/application_swagger.json
Normal file
File diff suppressed because it is too large
Load Diff
33
swagger/tag_groups/client.yml
Normal file
33
swagger/tag_groups/client.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
openapi: '3.0.4'
|
||||
info:
|
||||
title: Chatwoot - Client API
|
||||
description: Client API endpoints for Chatwoot
|
||||
version: 1.1.0
|
||||
termsOfService: https://www.chatwoot.com/terms-of-service/
|
||||
contact:
|
||||
email: hello@chatwoot.com
|
||||
license:
|
||||
name: MIT License
|
||||
url: https://opensource.org/licenses/MIT
|
||||
servers:
|
||||
- url: https://app.chatwoot.com/
|
||||
tags:
|
||||
- name: Contacts API
|
||||
description: APIs for managing contacts from client applications
|
||||
- name: Conversations API
|
||||
description: APIs for managing conversations from client applications
|
||||
- name: Messages API
|
||||
description: APIs for managing messages from client applications
|
||||
paths:
|
||||
$ref: ../paths/index.yml
|
||||
components:
|
||||
schemas:
|
||||
$ref: ../definitions/index.yml
|
||||
parameters:
|
||||
$ref: ../parameters/index.yml
|
||||
securitySchemes:
|
||||
userApiKey:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: api_access_token
|
||||
description: This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels.
|
||||
4963
swagger/tag_groups/client_swagger.json
Normal file
4963
swagger/tag_groups/client_swagger.json
Normal file
File diff suppressed because it is too large
Load Diff
4370
swagger/tag_groups/other_swagger.json
Normal file
4370
swagger/tag_groups/other_swagger.json
Normal file
File diff suppressed because it is too large
Load Diff
29
swagger/tag_groups/others.yml
Normal file
29
swagger/tag_groups/others.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
openapi: '3.0.4'
|
||||
info:
|
||||
title: Chatwoot - Other APIs
|
||||
description: Other API endpoints for Chatwoot
|
||||
version: 1.1.0
|
||||
termsOfService: https://www.chatwoot.com/terms-of-service/
|
||||
contact:
|
||||
email: hello@chatwoot.com
|
||||
license:
|
||||
name: MIT License
|
||||
url: https://opensource.org/licenses/MIT
|
||||
servers:
|
||||
- url: https://app.chatwoot.com/
|
||||
tags:
|
||||
- name: CSAT Survey Page
|
||||
description: APIs for CSAT survey functionality
|
||||
paths:
|
||||
$ref: ../paths/index.yml
|
||||
components:
|
||||
schemas:
|
||||
$ref: ../definitions/index.yml
|
||||
parameters:
|
||||
$ref: ../parameters/index.yml
|
||||
securitySchemes:
|
||||
userApiKey:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: api_access_token
|
||||
description: This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels.
|
||||
40
swagger/tag_groups/platform.yml
Normal file
40
swagger/tag_groups/platform.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
openapi: '3.0.4'
|
||||
info:
|
||||
title: Chatwoot - Platform API
|
||||
description: Platform API endpoints for Chatwoot
|
||||
version: 1.1.0
|
||||
termsOfService: https://www.chatwoot.com/terms-of-service/
|
||||
contact:
|
||||
email: hello@chatwoot.com
|
||||
license:
|
||||
name: MIT License
|
||||
url: https://opensource.org/licenses/MIT
|
||||
servers:
|
||||
- url: https://app.chatwoot.com/
|
||||
tags:
|
||||
- name: Accounts
|
||||
description: Platform account management
|
||||
- name: Account Users
|
||||
description: Manage users within platform accounts
|
||||
- name: AgentBots
|
||||
description: Manage agent bots on the platform
|
||||
- name: Users
|
||||
description: Platform user management
|
||||
paths:
|
||||
$ref: ../paths/index.yml
|
||||
components:
|
||||
schemas:
|
||||
$ref: ../definitions/index.yml
|
||||
parameters:
|
||||
$ref: ../parameters/index.yml
|
||||
securitySchemes:
|
||||
userApiKey:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: api_access_token
|
||||
description: This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels.
|
||||
platformAppApiKey:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: api_access_token
|
||||
description: This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles.
|
||||
5143
swagger/tag_groups/platform_swagger.json
Normal file
5143
swagger/tag_groups/platform_swagger.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user