chore: Update API docs (#1153)
This commit is contained in:
parent
dfe4b70d91
commit
662bb882f7
11 changed files with 259 additions and 6 deletions
|
@ -19,6 +19,11 @@ inbox:
|
||||||
$ref: ./resource/inbox.yml
|
$ref: ./resource/inbox.yml
|
||||||
agent_bot:
|
agent_bot:
|
||||||
$ref: ./resource/agent_bot.yml
|
$ref: ./resource/agent_bot.yml
|
||||||
|
contact_inboxes:
|
||||||
|
$ref: ./resource/contact_inboxes.yml
|
||||||
|
account:
|
||||||
|
$ref: ./resource/account.yml
|
||||||
|
|
||||||
# RESPONSE
|
# RESPONSE
|
||||||
|
|
||||||
## contact
|
## contact
|
||||||
|
|
12
swagger/definitions/resource/account.yml
Normal file
12
swagger/definitions/resource/account.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: number
|
||||||
|
description: Account ID
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
description: Name of the account
|
||||||
|
role:
|
||||||
|
type: string
|
||||||
|
enum: ['administrator', 'agent']
|
||||||
|
description: The user role in the account
|
|
@ -15,3 +15,7 @@ properties:
|
||||||
additional_attributes:
|
additional_attributes:
|
||||||
type: object
|
type: object
|
||||||
description: The object containing additional attributes related to the contact
|
description: The object containing additional attributes related to the contact
|
||||||
|
contact_inboxes:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/contact_inboxes'
|
||||||
|
|
8
swagger/definitions/resource/contact_inboxes.yml
Normal file
8
swagger/definitions/resource/contact_inboxes.yml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
source_id:
|
||||||
|
type: string
|
||||||
|
description: Contact Inbox Source Id
|
||||||
|
inbox:
|
||||||
|
type: object
|
||||||
|
$ref: '#/definitions/inbox'
|
|
@ -33,6 +33,9 @@ properties:
|
||||||
welcome_tagline:
|
welcome_tagline:
|
||||||
type: string
|
type: string
|
||||||
description: Welcome tagline to be displayed on the widget
|
description: Welcome tagline to be displayed on the widget
|
||||||
agent_away_message:
|
greeting_enabled:
|
||||||
|
type: boolean
|
||||||
|
description: The flag which shows whether greeting is enabled
|
||||||
|
greeting_message:
|
||||||
type: string
|
type: string
|
||||||
description: A message which will be sent if there is not agent available. This is not available if agentbot is connected
|
description: A greeting message when the user starts the conversation
|
||||||
|
|
|
@ -6,6 +6,10 @@ properties:
|
||||||
type: string
|
type: string
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
|
available_name:
|
||||||
|
type: string
|
||||||
|
display_name:
|
||||||
|
type: string
|
||||||
email:
|
email:
|
||||||
type: string
|
type: string
|
||||||
account_id:
|
account_id:
|
||||||
|
@ -17,3 +21,7 @@ properties:
|
||||||
type: boolean
|
type: boolean
|
||||||
display_name:
|
display_name:
|
||||||
type: string
|
type: string
|
||||||
|
accounts:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/account'
|
||||||
|
|
22
swagger/paths/contact/search.yml
Normal file
22
swagger/paths/contact/search.yml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- Contact
|
||||||
|
operationId: contactSearch
|
||||||
|
description: Search the contacts using a search key, currently supports email search
|
||||||
|
summary: Search Contacts
|
||||||
|
parameters:
|
||||||
|
- name: q
|
||||||
|
in: query
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Success
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
payload:
|
||||||
|
$ref: '#/definitions/contact_list'
|
||||||
|
401:
|
||||||
|
description: Authentication error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/bad_request_error'
|
21
swagger/paths/contact_inboxes/create.yml
Normal file
21
swagger/paths/contact_inboxes/create.yml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- Contact
|
||||||
|
operationId: contactInboxCreation
|
||||||
|
description: Create a contact inbox record for an inbox
|
||||||
|
summary: Create contact inbox
|
||||||
|
parameters:
|
||||||
|
- name: inbox_id
|
||||||
|
in: params
|
||||||
|
type: number
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Success
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/contact_inboxes'
|
||||||
|
401:
|
||||||
|
description: Authentication error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/bad_request_error'
|
||||||
|
422:
|
||||||
|
description: Incorrect payload
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Inboxes
|
# Inboxes
|
||||||
/accounts/{account_id}/inboxes:
|
/accounts/{account_id}/inboxes:
|
||||||
$ref: ./inboxes/index.yml
|
$ref: ./inboxes/index.yml
|
||||||
|
@ -34,7 +35,20 @@
|
||||||
# Contacts
|
# Contacts
|
||||||
/accounts/{account_id}/contacts:
|
/accounts/{account_id}/contacts:
|
||||||
$ref: ./contact/list_create.yml
|
$ref: ./contact/list_create.yml
|
||||||
|
|
||||||
/accounts/{account_id}/contacts/{id}:
|
/accounts/{account_id}/contacts/{id}:
|
||||||
$ref: ./contact/crud.yml
|
$ref: ./contact/crud.yml
|
||||||
|
|
||||||
/accounts/{account_id}/contacts/{id}/conversations:
|
/accounts/{account_id}/contacts/{id}/conversations:
|
||||||
$ref: ./contact/conversations.yml
|
$ref: ./contact/conversations.yml
|
||||||
|
|
||||||
|
/accounts/{account_id}/contacts/search:
|
||||||
|
$ref: ./contact/search.yml
|
||||||
|
|
||||||
|
/accounts/{account_id}/contacts/{id}/contact_inboxes:
|
||||||
|
$ref: ./contact_inboxes/create.yml
|
||||||
|
|
||||||
|
|
||||||
|
# Profile
|
||||||
|
/profile:
|
||||||
|
$ref: ./profile/index.yml
|
||||||
|
|
13
swagger/paths/profile/index.yml
Normal file
13
swagger/paths/profile/index.yml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- Profile
|
||||||
|
operationId: fetchProfile
|
||||||
|
summary: Fetch user profile
|
||||||
|
description: Get the user profile details
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Success
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/user'
|
||||||
|
401:
|
||||||
|
description: Unauthorized
|
|
@ -895,6 +895,97 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"/accounts/{account_id}/contacts/search": {
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"Contact"
|
||||||
|
],
|
||||||
|
"operationId": "contactSearch",
|
||||||
|
"description": "Search the contacts using a search key, currently supports email search",
|
||||||
|
"summary": "Search Contacts",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "q",
|
||||||
|
"in": "query",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Success",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"payload": {
|
||||||
|
"$ref": "#/definitions/contact_list"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "Authentication error",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/bad_request_error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/accounts/{account_id}/contacts/{id}/contact_inboxes": {
|
||||||
|
"post": {
|
||||||
|
"tags": [
|
||||||
|
"Contact"
|
||||||
|
],
|
||||||
|
"operationId": "contactInboxCreation",
|
||||||
|
"description": "Create a contact inbox record for an inbox",
|
||||||
|
"summary": "Create contact inbox",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "inbox_id",
|
||||||
|
"in": "params",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Success",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/contact_inboxes"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "Authentication error",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/bad_request_error"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "Incorrect payload"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/profile": {
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"Profile"
|
||||||
|
],
|
||||||
|
"operationId": "fetchProfile",
|
||||||
|
"summary": "Fetch user profile",
|
||||||
|
"description": "Get the user profile details",
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Success",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/user"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "Unauthorized"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"definitions": {
|
"definitions": {
|
||||||
|
@ -957,6 +1048,12 @@
|
||||||
"additional_attributes": {
|
"additional_attributes": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "The object containing additional attributes related to the contact"
|
"description": "The object containing additional attributes related to the contact"
|
||||||
|
},
|
||||||
|
"contact_inboxes": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/contact_inboxes"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1072,6 +1169,12 @@
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"available_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"display_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"email": {
|
"email": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -1088,8 +1191,11 @@
|
||||||
"confirmed": {
|
"confirmed": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"display_name": {
|
"accounts": {
|
||||||
"type": "string"
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/account"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1140,9 +1246,13 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Welcome tagline to be displayed on the widget"
|
"description": "Welcome tagline to be displayed on the widget"
|
||||||
},
|
},
|
||||||
"agent_away_message": {
|
"greeting_enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "The flag which shows whether greeting is enabled"
|
||||||
|
},
|
||||||
|
"greeting_message": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A message which will be sent if there is not agent available. This is not available if agentbot is connected"
|
"description": "A greeting message when the user starts the conversation"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1167,6 +1277,39 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"contact_inboxes": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"source_id": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Contact Inbox Source Id"
|
||||||
|
},
|
||||||
|
"inbox": {
|
||||||
|
"$ref": "#/definitions/inbox"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"account": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Account ID"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of the account"
|
||||||
|
},
|
||||||
|
"role": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"administrator",
|
||||||
|
"agent"
|
||||||
|
],
|
||||||
|
"description": "The user role in the account"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"extended_contact": {
|
"extended_contact": {
|
||||||
"allOf": [
|
"allOf": [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue