fix: Test all endpoints, ensuring payloads work correctly

This commit is contained in:
Daniel Jimenez
2025-05-13 17:24:36 +12:00
parent 2c3a3bbbd2
commit aedec95e37
28 changed files with 484 additions and 289 deletions
+4 -2
View File
@@ -110,8 +110,10 @@ conversation_message_create_payload:
$ref: ./request/conversation/create_message_payload.yml
# Inbox
inbox_create_update_payload:
$ref: ./request/inbox/create_update_payload.yml
inbox_create_payload:
$ref: ./request/inbox/create_payload.yml
inbox_update_payload:
$ref: ./request/inbox/update_payload.yml
# Team
team_create_update_payload:
@@ -7,10 +7,10 @@ properties:
enum: ['agent', 'administrator']
description: Whether its administrator or agent
example: 'agent'
availability:
availability_status:
type: string
enum: ['available', 'busy', 'offline']
description: The availability setting of the agent.
description: The availability status of the agent.
example: 'available'
auto_offline:
type: boolean
@@ -36,6 +36,6 @@ properties:
example:
attribute_key: content
filter_operator: contains
query_operator: nil
query_operator: OR
values:
- help
@@ -21,7 +21,7 @@ properties:
phone_number:
type: string
description: phone number of the contact
example: +123456789
example: '+123456789'
avatar:
type: string
format: binary
@@ -15,7 +15,7 @@ properties:
phone_number:
type: string
description: phone number of the contact
example: +123456789
example: '+123456789'
avatar:
type: string
format: binary
@@ -19,11 +19,11 @@ properties:
type: string
enum: ['text', 'input_email', 'cards', 'input_select', 'form', 'article']
description: Content type of the message
example: 'cards'
example: 'text'
content_attributes:
type: object
description: Attributes based on the content type
example: { automation_rule_id: 1, in_reply_to: 1 }
example: {}
campaign_id:
type: integer
description: The campaign id to which the message belongs
@@ -23,7 +23,7 @@ properties:
csat_survey_enabled:
type: boolean
description: Enable CSAT survey
example: tru
example: true
enable_auto_assignment:
type: boolean
description: Enable Auto Assignment
@@ -0,0 +1,82 @@
type: object
properties:
name:
type: string
description: The name of the inbox
example: 'Support'
avatar:
type: string
format: binary
description: Image file for avatar
greeting_enabled:
type: boolean
description: Enable greeting message
example: true
greeting_message:
type: string
description: Greeting message to be displayed on the widget
example: Hello, how can I help you?
enable_email_collect:
type: boolean
description: Enable email collection
example: true
csat_survey_enabled:
type: boolean
description: Enable CSAT survey
example: true
enable_auto_assignment:
type: boolean
description: Enable Auto Assignment
example: true
working_hours_enabled:
type: boolean
description: Enable working hours
example: true
out_of_office_message:
type: string
description: Out of office message to be displayed on the widget
example: We are currently out of office. Please leave a message and we will get back to you.
timezone:
type: string
description: Timezone of the inbox
example: 'America/New_York'
allow_messages_after_resolved:
type: boolean
description: Allow messages after conversation is resolved
example: true
lock_to_single_conversation:
type: boolean
description: Lock to single conversation
example: true
portal_id:
type: integer
description: Id of the help center portal to attach to the inbox
example: 1
sender_name_type:
type: string
description: Sender name type for the inbox
enum: ['friendly', 'professional']
example: 'friendly'
business_name:
type: string
description: Business name for the inbox
example: 'My Business'
channel:
type: object
properties:
website_url:
type: string
description: URL at which the widget will be loaded
example: 'https://example.com'
welcome_title:
type: string
description: Welcome title to be displayed on the widget
example: 'Welcome to our support'
welcome_tagline:
type: string
description: Welcome tagline to be displayed on the widget
example: 'We are here to help you'
widget_color:
type: string
description: A Hex-color string used to customize the widget
example: '#FF5733'
@@ -22,8 +22,8 @@ properties:
example: en
icon:
type: string
description: The icon of the category, e.g. i-lucide-home
example: 'i-lucide-home'
description: The icon of the category as a string (emoji)
example: '📚'
parent_category_id:
type: integer
description: To define parent category, e.g product documentation has multiple level features in sales category or in engineering category.
@@ -1,9 +1,5 @@
type: object
properties:
account_id:
type: integer
description: The account id of the portal
example: 1
color:
type: string
description: Header color for help-center in hex format
@@ -19,7 +19,7 @@ properties:
phone_number:
type: string
description: Phone number of the contact
example: +123456789
example: '+123456789'
avatar:
type: string
format: binary
-3
View File
@@ -48,9 +48,6 @@ x-tagGroups:
- Agents
- Canned Responses
- Contacts
- Contact Labels
- Conversation Assignment
- Conversation Labels
- Conversations
- Custom Attributes
- Custom Filters
+3 -3
View File
@@ -1,6 +1,6 @@
in: path
name: portal_id
name: id
schema:
type: integer
type: string
required: true
description: The numeric ID of the portal
description: The slug identifier of the portal
@@ -0,0 +1,79 @@
parameters:
- $ref: '#/components/parameters/account_id'
- name: id
in: path
required: true
schema:
type: number
description: ID of the contact
get:
tags:
- Contacts
operationId: list-all-labels-of-a-contact
summary: List Labels
description: Lists all the labels of a contact
security:
- userApiKey: []
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/contact_labels'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: Contact not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
post:
tags:
- Contacts
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.
security:
- userApiKey: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- labels
properties:
labels:
type: array
description: Array of labels (comma-separated strings)
items:
type: string
example: ['support', 'billing']
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/contact_labels'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: Contact not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
@@ -1,41 +0,0 @@
tags:
- 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.
security:
- userApiKey: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- labels
properties:
labels:
type: array
description: Array of labels (comma-separated strings)
items:
type: string
example: ['support', 'billing']
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/contact_labels'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: Contact not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
@@ -1,26 +0,0 @@
tags:
- Contact Labels
operationId: list-all-labels-of-a-contact
summary: List Labels
description: Lists all the labels of a contact
security:
- userApiKey: []
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/contact_labels'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: Contact not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
@@ -1,5 +1,5 @@
tags:
- Conversation Assignment
- Conversations
operationId: assign-a-conversation
summary: Assign Conversation
description: Assign a conversation to an agent or a team
@@ -40,11 +40,11 @@ requestBody:
enum: [AND, OR]
example:
- attribute_key: 'browser_language'
filter_operator: 'not_eq'
filter_operator: 'not_equal_to'
values: ['en']
query_operator: 'AND'
- attribute_key: 'status'
filter_operator: 'eq'
filter_operator: 'equal_to'
values: ['pending']
query_operator: null
@@ -1,5 +1,5 @@
tags:
- Conversation Labels
- Conversations
operationId: conversation-add-labels
summary: Add Labels
security:
@@ -1,5 +1,5 @@
tags:
- Conversation Labels
- Conversations
operationId: list-all-labels-of-a-conversation
summary: List Labels
security:
+1 -1
View File
@@ -13,7 +13,7 @@ post:
content:
application/json:
schema:
$ref: '#/components/schemas/inbox_create_update_payload'
$ref: '#/components/schemas/inbox_create_payload'
responses:
'200':
description: Success
@@ -24,7 +24,7 @@ requestBody:
items:
type: integer
description: IDs of users to be added to the inbox
example: [1, 2, 3]
example: [1]
responses:
'200':
description: Success
@@ -24,7 +24,7 @@ requestBody:
items:
type: integer
description: IDs of users to be added to the inbox
example: [1, 2, 3]
example: [1]
responses:
'200':
description: Success
+2 -2
View File
@@ -5,7 +5,7 @@ patch:
summary: Update Inbox
security:
- userApiKey: []
description: Add avatar and disable auto assignment for an inbox
description: Update an existing inbox
parameters:
- $ref: '#/components/parameters/account_id'
- name: id
@@ -19,7 +19,7 @@ patch:
content:
application/json:
schema:
$ref: '#/components/schemas/inbox_create_update_payload'
$ref: '#/components/schemas/inbox_update_payload'
responses:
'200':
description: Success
@@ -19,7 +19,7 @@ requestBody:
items:
type: integer
description: IDs of users to be added to the team
example: [1, 2, 3]
example: [1]
responses:
'200':
description: Success
@@ -19,7 +19,7 @@ requestBody:
items:
type: integer
description: IDs of users to be added to the team
example: [1, 2, 3]
example: [1]
responses:
'200':
description: Success
+9 -10
View File
@@ -151,14 +151,6 @@
- $ref: '#/components/parameters/message_id'
patch:
$ref: ./public/inboxes/messages/update.yml
/api/v1/accounts/{account_id}/contacts/{contact_identifier}/labels:
parameters:
- $ref: '#/components/parameters/account_id'
- $ref: '#/components/parameters/public_contact_identifier'
get:
$ref: ./application/contacts/labels/index.yml
post:
$ref: ./application/contacts/labels/create.yml
# ---------------- end of public api routes-----------#
@@ -256,6 +248,8 @@
$ref: ./application/contacts/crud.yml
/api/v1/accounts/{account_id}/contacts/{id}/conversations:
$ref: ./application/contacts/conversations.yml
/api/v1/accounts/{account_id}/contacts/{id}/labels:
$ref: ./application/contacts/labels.yml
/api/v1/accounts/{account_id}/contacts/search:
$ref: ./application/contacts/search.yml
/api/v1/accounts/{account_id}/contacts/filter:
@@ -265,6 +259,7 @@
/api/v1/accounts/{account_id}/contacts/{id}/contactable_inboxes:
$ref: ./application/contactable_inboxes/get.yml
# Automation Rule
/api/v1/accounts/{account_id}/automation_rules:
parameters:
@@ -297,11 +292,15 @@
$ref: ./application/portal/create.yml
get:
$ref: ./application/portal/index.yml
/api/v1/accounts/{account_id}/portals/{id}:
parameters:
- $ref: '#/components/parameters/account_id'
- $ref: '#/components/parameters/portal_id'
patch:
$ref: ./application/portal/update.yml
# Help Center category
/api/v1/accounts/{account_id}/portals/{portal_id}/categories:
/api/v1/accounts/{account_id}/portals/{id}/categories:
parameters:
- $ref: '#/components/parameters/account_id'
- $ref: '#/components/parameters/portal_id'
@@ -309,7 +308,7 @@
$ref: ./application/category/create.yml
# Help Center article
/api/v1/accounts/{account_id}/portals/{portal_id}/articles:
/api/v1/accounts/{account_id}/portals/{id}/articles:
parameters:
- $ref: '#/components/parameters/account_id'
- $ref: '#/components/parameters/portal_id'
+284 -177
View File
@@ -1515,136 +1515,6 @@
}
}
},
"/api/v1/accounts/{account_id}/contacts/{contact_identifier}/labels": {
"parameters": [
{
"$ref": "#/components/parameters/account_id"
},
{
"$ref": "#/components/parameters/public_contact_identifier"
}
],
"get": {
"tags": [
"Contact Labels"
],
"operationId": "list-all-labels-of-a-contact",
"summary": "List Labels",
"description": "Lists all the labels of a contact",
"security": [
{
"userApiKey": [
]
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/contact_labels"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bad_request_error"
}
}
}
},
"404": {
"description": "Contact not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bad_request_error"
}
}
}
}
}
},
"post": {
"tags": [
"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.",
"security": [
{
"userApiKey": [
]
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"labels"
],
"properties": {
"labels": {
"type": "array",
"description": "Array of labels (comma-separated strings)",
"items": {
"type": "string"
},
"example": [
"support",
"billing"
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/contact_labels"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bad_request_error"
}
}
}
},
"404": {
"description": "Contact not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bad_request_error"
}
}
}
}
}
}
},
"/survey/responses/{conversation_uuid}": {
"parameters": [
{
@@ -2994,6 +2864,142 @@
}
}
},
"/api/v1/accounts/{account_id}/contacts/{id}/labels": {
"parameters": [
{
"$ref": "#/components/parameters/account_id"
},
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "number"
},
"description": "ID of the contact"
}
],
"get": {
"tags": [
"Contacts"
],
"operationId": "list-all-labels-of-a-contact",
"summary": "List Labels",
"description": "Lists all the labels of a contact",
"security": [
{
"userApiKey": [
]
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/contact_labels"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bad_request_error"
}
}
}
},
"404": {
"description": "Contact not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bad_request_error"
}
}
}
}
}
},
"post": {
"tags": [
"Contacts"
],
"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.",
"security": [
{
"userApiKey": [
]
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"labels"
],
"properties": {
"labels": {
"type": "array",
"description": "Array of labels (comma-separated strings)",
"items": {
"type": "string"
},
"example": [
"support",
"billing"
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/contact_labels"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bad_request_error"
}
}
}
},
"404": {
"description": "Contact not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bad_request_error"
}
}
}
}
}
}
},
"/api/v1/accounts/{account_id}/contacts/search": {
"get": {
"tags": [
@@ -3719,7 +3725,17 @@
}
}
}
},
}
},
"/api/v1/accounts/{account_id}/portals/{id}": {
"parameters": [
{
"$ref": "#/components/parameters/account_id"
},
{
"$ref": "#/components/parameters/portal_id"
}
],
"patch": {
"tags": [
"Help Center"
@@ -3768,7 +3784,7 @@
}
}
},
"/api/v1/accounts/{account_id}/portals/{portal_id}/categories": {
"/api/v1/accounts/{account_id}/portals/{id}/categories": {
"parameters": [
{
"$ref": "#/components/parameters/account_id"
@@ -3825,7 +3841,7 @@
}
}
},
"/api/v1/accounts/{account_id}/portals/{portal_id}/articles": {
"/api/v1/accounts/{account_id}/portals/{id}/articles": {
"parameters": [
{
"$ref": "#/components/parameters/account_id"
@@ -4254,7 +4270,7 @@
"example": [
{
"attribute_key": "browser_language",
"filter_operator": "not_eq",
"filter_operator": "not_equal_to",
"values": [
"en"
],
@@ -4262,7 +4278,7 @@
},
{
"attribute_key": "status",
"filter_operator": "eq",
"filter_operator": "equal_to",
"values": [
"pending"
],
@@ -4696,7 +4712,7 @@
],
"post": {
"tags": [
"Conversation Assignment"
"Conversations"
],
"operationId": "assign-a-conversation",
"summary": "Assign Conversation",
@@ -4780,7 +4796,7 @@
],
"get": {
"tags": [
"Conversation Labels"
"Conversations"
],
"operationId": "list-all-labels-of-a-conversation",
"summary": "List Labels",
@@ -4827,7 +4843,7 @@
},
"post": {
"tags": [
"Conversation Labels"
"Conversations"
],
"operationId": "conversation-add-labels",
"summary": "Add Labels",
@@ -5045,7 +5061,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/inbox_create_update_payload"
"$ref": "#/components/schemas/inbox_create_payload"
}
}
}
@@ -5098,7 +5114,7 @@
]
}
],
"description": "Add avatar and disable auto assignment for an inbox",
"description": "Update an existing inbox",
"parameters": [
{
"$ref": "#/components/parameters/account_id"
@@ -5118,7 +5134,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/inbox_create_update_payload"
"$ref": "#/components/schemas/inbox_update_payload"
}
}
}
@@ -5405,9 +5421,7 @@
},
"description": "IDs of users to be added to the inbox",
"example": [
1,
2,
3
1
]
}
}
@@ -5499,9 +5513,7 @@
},
"description": "IDs of users to be added to the inbox",
"example": [
1,
2,
3
1
]
}
}
@@ -6423,9 +6435,7 @@
},
"description": "IDs of users to be added to the team",
"example": [
1,
2,
3
1
]
}
}
@@ -6511,9 +6521,7 @@
},
"description": "IDs of users to be added to the team",
"example": [
1,
2,
3
1
]
}
}
@@ -8790,14 +8798,14 @@
"description": "Whether its administrator or agent",
"example": "agent"
},
"availability": {
"availability_status": {
"type": "string",
"enum": [
"available",
"busy",
"offline"
],
"description": "The availability setting of the agent.",
"description": "The availability status of the agent.",
"example": "available"
},
"auto_offline": {
@@ -8836,7 +8844,7 @@
"phone_number": {
"type": "string",
"description": "phone number of the contact",
"example": 123456789
"example": "+123456789"
},
"avatar": {
"type": "string",
@@ -8890,7 +8898,7 @@
"phone_number": {
"type": "string",
"description": "phone number of the contact",
"example": 123456789
"example": "+123456789"
},
"avatar": {
"type": "string",
@@ -9069,14 +9077,12 @@
"article"
],
"description": "Content type of the message",
"example": "cards"
"example": "text"
},
"content_attributes": {
"type": "object",
"description": "Attributes based on the content type",
"example": {
"automation_rule_id": 1,
"in_reply_to": 1
}
},
"campaign_id": {
@@ -9114,7 +9120,7 @@
}
}
},
"inbox_create_update_payload": {
"inbox_create_payload": {
"type": "object",
"properties": {
"name": {
@@ -9145,7 +9151,7 @@
"csat_survey_enabled": {
"type": "boolean",
"description": "Enable CSAT survey",
"example": "tru"
"example": true
},
"enable_auto_assignment": {
"type": "boolean",
@@ -9237,6 +9243,115 @@
}
}
},
"inbox_update_payload": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the inbox",
"example": "Support"
},
"avatar": {
"type": "string",
"format": "binary",
"description": "Image file for avatar"
},
"greeting_enabled": {
"type": "boolean",
"description": "Enable greeting message",
"example": true
},
"greeting_message": {
"type": "string",
"description": "Greeting message to be displayed on the widget",
"example": "Hello, how can I help you?"
},
"enable_email_collect": {
"type": "boolean",
"description": "Enable email collection",
"example": true
},
"csat_survey_enabled": {
"type": "boolean",
"description": "Enable CSAT survey",
"example": true
},
"enable_auto_assignment": {
"type": "boolean",
"description": "Enable Auto Assignment",
"example": true
},
"working_hours_enabled": {
"type": "boolean",
"description": "Enable working hours",
"example": true
},
"out_of_office_message": {
"type": "string",
"description": "Out of office message to be displayed on the widget",
"example": "We are currently out of office. Please leave a message and we will get back to you."
},
"timezone": {
"type": "string",
"description": "Timezone of the inbox",
"example": "America/New_York"
},
"allow_messages_after_resolved": {
"type": "boolean",
"description": "Allow messages after conversation is resolved",
"example": true
},
"lock_to_single_conversation": {
"type": "boolean",
"description": "Lock to single conversation",
"example": true
},
"portal_id": {
"type": "integer",
"description": "Id of the help center portal to attach to the inbox",
"example": 1
},
"sender_name_type": {
"type": "string",
"description": "Sender name type for the inbox",
"enum": [
"friendly",
"professional"
],
"example": "friendly"
},
"business_name": {
"type": "string",
"description": "Business name for the inbox",
"example": "My Business"
},
"channel": {
"type": "object",
"properties": {
"website_url": {
"type": "string",
"description": "URL at which the widget will be loaded",
"example": "https://example.com"
},
"welcome_title": {
"type": "string",
"description": "Welcome title to be displayed on the widget",
"example": "Welcome to our support"
},
"welcome_tagline": {
"type": "string",
"description": "Welcome tagline to be displayed on the widget",
"example": "We are here to help you"
},
"widget_color": {
"type": "string",
"description": "A Hex-color string used to customize the widget",
"example": "#FF5733"
}
}
}
}
},
"team_create_update_payload": {
"type": "object",
"properties": {
@@ -9404,7 +9519,7 @@
"example": {
"attribute_key": "content",
"filter_operator": "contains",
"query_operator": "nil",
"query_operator": "OR",
"values": [
"help"
]
@@ -9416,11 +9531,6 @@
"portal_create_update_payload": {
"type": "object",
"properties": {
"account_id": {
"type": "integer",
"description": "The account id of the portal",
"example": 1
},
"color": {
"type": "string",
"description": "Header color for help-center in hex format",
@@ -9504,8 +9614,8 @@
},
"icon": {
"type": "string",
"description": "The icon of the category, e.g. i-lucide-home",
"example": "i-lucide-home"
"description": "The icon of the category as a string (emoji)",
"example": "📚"
},
"parent_category_id": {
"type": "integer",
@@ -9611,7 +9721,7 @@
"phone_number": {
"type": "string",
"description": "Phone number of the contact",
"example": 123456789
"example": "+123456789"
},
"avatar": {
"type": "string",
@@ -10231,12 +10341,12 @@
},
"portal_id": {
"in": "path",
"name": "portal_id",
"name": "id",
"schema": {
"type": "integer"
"type": "string"
},
"required": true,
"description": "The numeric ID of the portal"
"description": "The slug identifier of the portal"
}
},
"securitySchemes": {
@@ -10277,9 +10387,6 @@
"Agents",
"Canned Responses",
"Contacts",
"Contact Labels",
"Conversation Assignment",
"Conversation Labels",
"Conversations",
"Custom Attributes",
"Custom Filters",