Documents the existing API inbox webhook_url request field and expands inbox create/update request docs with channel-specific schemas and examples. Closes #14591 ## Why API inboxes already accept channel.webhook_url through Channel::Api editable attributes, but the OpenAPI request schemas did not document the field. The previous mixed channel object also made it hard to see which fields belong to each supported channel type. ## What changed - Added named channel payload schemas for supported inbox create channel types. - Added channel-specific create request samples in this order: Website inbox, API channel, Email channel, LINE channel, Telegram channel, WhatsApp channel, SMS channel. - Added common inbox fields such as greeting_enabled, greeting_message, enable_auto_assignment, working_hours_enabled, and timezone to request samples. - Kept website-only flags such as allow_messages_after_resolved and enable_email_collect only in website inbox samples. - Annotated inbox request field descriptions with channel availability where Swagger UI cannot dynamically filter fields. - Added channel-specific update settings schemas and request samples for editable channel attributes. - Documented channel.webhook_url for API inbox create/update payloads. - Rebuilt generated Swagger JSON and tag-group specs. ## Screenshots **Website inbox request sample** Shows the request sample selector set to Website inbox, including website-only fields such as enable_email_collect and allow_messages_after_resolved. <img width="3840" height="2160" alt="Website inbox request sample" src="https://github.com/user-attachments/assets/ad130f04-b336-4cc3-aba1-e934b646d447" /> **API channel request sample** Shows the selector switched to API channel, with API-specific fields such as webhook_url, hmac_mandatory, and additional_attributes. <img width="3840" height="2160" alt="API channel request sample" src="https://github.com/user-attachments/assets/09484816-1d47-490f-9ab4-195835ed5cd3" /> **Expanded channel schema** Shows the request-body schema with channel expanded, including the type selector and channel-specific fields under it. <img width="3840" height="2160" alt="Expanded channel schema" src="https://github.com/user-attachments/assets/f6c4878e-ac34-40fe-8be3-5913f27cbdd8" /> ## Validation - bundle exec rake swagger:build - bundle exec rspec spec/swagger/openapi_spec.rb - Rendered the local Swagger page and verified the request sample dropdown order and API channel payload. --------- Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
186 lines
6.0 KiB
YAML
186 lines
6.0 KiB
YAML
get:
|
|
tags:
|
|
- Inboxes
|
|
operationId: listAllInboxes
|
|
summary: List all inboxes
|
|
description: List all inboxes available in the current account
|
|
security:
|
|
- userApiKey: []
|
|
parameters:
|
|
- $ref: '#/components/parameters/account_id'
|
|
responses:
|
|
'200':
|
|
description: Success
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
payload:
|
|
type: array
|
|
description: 'Array of inboxes'
|
|
items:
|
|
$ref: '#/components/schemas/inbox'
|
|
'404':
|
|
description: Inbox not found
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/bad_request_error'
|
|
'403':
|
|
description: Access denied
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/bad_request_error'
|
|
post:
|
|
tags:
|
|
- Inboxes
|
|
operationId: inboxCreation
|
|
summary: Create an inbox
|
|
description: You can create more than one website inbox in each account
|
|
security:
|
|
- userApiKey: []
|
|
parameters:
|
|
- $ref: '#/components/parameters/account_id'
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/inbox_create_payload'
|
|
examples:
|
|
web_widget:
|
|
summary: Website inbox
|
|
value:
|
|
name: Support
|
|
greeting_enabled: true
|
|
greeting_message: Hello, how can I help you?
|
|
enable_email_collect: true
|
|
enable_auto_assignment: true
|
|
working_hours_enabled: true
|
|
timezone: America/New_York
|
|
allow_messages_after_resolved: true
|
|
channel:
|
|
type: web_widget
|
|
website_url: https://example.com
|
|
welcome_title: Welcome to our support
|
|
welcome_tagline: We are here to help you
|
|
widget_color: '#FF5733'
|
|
reply_time: in_a_few_minutes
|
|
pre_chat_form_enabled: false
|
|
continuity_via_email: true
|
|
hmac_mandatory: false
|
|
selected_feature_flags:
|
|
- attachments
|
|
- emoji_picker
|
|
- end_conversation
|
|
api:
|
|
summary: API channel
|
|
value:
|
|
name: API Inbox
|
|
greeting_enabled: true
|
|
greeting_message: Hello, how can I help you?
|
|
enable_auto_assignment: true
|
|
working_hours_enabled: true
|
|
timezone: America/New_York
|
|
channel:
|
|
type: api
|
|
webhook_url: https://example.com/webhook
|
|
hmac_mandatory: false
|
|
additional_attributes:
|
|
source: mobile_app
|
|
email:
|
|
summary: Email channel
|
|
value:
|
|
name: Email Inbox
|
|
greeting_enabled: true
|
|
greeting_message: Hello, how can I help you?
|
|
enable_auto_assignment: true
|
|
working_hours_enabled: true
|
|
timezone: America/New_York
|
|
channel:
|
|
type: email
|
|
email: support@example.com
|
|
imap_enabled: false
|
|
smtp_enabled: false
|
|
line:
|
|
summary: LINE channel
|
|
value:
|
|
name: LINE Inbox
|
|
greeting_enabled: true
|
|
greeting_message: Hello, how can I help you?
|
|
enable_auto_assignment: true
|
|
working_hours_enabled: true
|
|
timezone: America/New_York
|
|
channel:
|
|
type: line
|
|
line_channel_id: '1234567890'
|
|
line_channel_secret: line-channel-secret
|
|
line_channel_token: line-channel-token
|
|
telegram:
|
|
summary: Telegram channel
|
|
value:
|
|
name: Telegram Inbox
|
|
greeting_enabled: true
|
|
greeting_message: Hello, how can I help you?
|
|
enable_auto_assignment: true
|
|
working_hours_enabled: true
|
|
timezone: America/New_York
|
|
channel:
|
|
type: telegram
|
|
bot_token: 123456789:telegram-bot-token
|
|
whatsapp:
|
|
summary: WhatsApp channel
|
|
value:
|
|
name: WhatsApp Inbox
|
|
greeting_enabled: true
|
|
greeting_message: Hello, how can I help you?
|
|
enable_auto_assignment: true
|
|
working_hours_enabled: true
|
|
timezone: America/New_York
|
|
channel:
|
|
type: whatsapp
|
|
phone_number: '+15551234567'
|
|
provider: whatsapp_cloud
|
|
provider_config:
|
|
api_key: your-api-key
|
|
phone_number_id: your-phone-number-id
|
|
business_account_id: your-business-account-id
|
|
sms:
|
|
summary: SMS channel
|
|
value:
|
|
name: SMS Inbox
|
|
greeting_enabled: true
|
|
greeting_message: Hello, how can I help you?
|
|
enable_auto_assignment: true
|
|
working_hours_enabled: true
|
|
timezone: America/New_York
|
|
channel:
|
|
type: sms
|
|
phone_number: '+15551234567'
|
|
provider_config:
|
|
api_key: your-api-key
|
|
api_secret: your-api-secret
|
|
application_id: your-application-id
|
|
account_id: your-account-id
|
|
responses:
|
|
'200':
|
|
description: Success
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/inbox'
|
|
'404':
|
|
description: Inbox not found
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/bad_request_error'
|
|
'403':
|
|
description: Access denied
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/bad_request_error'
|