chore: Update the documentation for configuring webhooks in the account (#4703)
This commit is contained in:
parent
8538660bbd
commit
11ea8a3032
12 changed files with 340 additions and 18 deletions
|
@ -36,6 +36,8 @@ contactable_inboxes:
|
||||||
$ref: ./resource/contactable_inboxes.yml
|
$ref: ./resource/contactable_inboxes.yml
|
||||||
custom_filter:
|
custom_filter:
|
||||||
$ref: ./resource/custom_filter.yml
|
$ref: ./resource/custom_filter.yml
|
||||||
|
webhook:
|
||||||
|
$ref: ./resource/webhook.yml
|
||||||
account:
|
account:
|
||||||
$ref: ./resource/account.yml
|
$ref: ./resource/account.yml
|
||||||
platform_account:
|
platform_account:
|
||||||
|
@ -91,6 +93,9 @@ team_create_update_payload:
|
||||||
custom_filter_create_update_payload:
|
custom_filter_create_update_payload:
|
||||||
$ref: ./request/custom_filter/create_update_payload.yml
|
$ref: ./request/custom_filter/create_update_payload.yml
|
||||||
|
|
||||||
|
webhook_create_update_payload:
|
||||||
|
$ref: ./request/webhooks/create_update_payload.yml
|
||||||
|
|
||||||
integrations_hook_create_payload:
|
integrations_hook_create_payload:
|
||||||
$ref: ./request/integrations/hook_create_payload.yml
|
$ref: ./request/integrations/hook_create_payload.yml
|
||||||
|
|
||||||
|
@ -158,6 +163,3 @@ account_summary:
|
||||||
$ref: './resource/reports/summary.yml'
|
$ref: './resource/reports/summary.yml'
|
||||||
agent_conversation_metrics:
|
agent_conversation_metrics:
|
||||||
$ref: './resource/reports/conversation/agent.yml'
|
$ref: './resource/reports/conversation/agent.yml'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
url:
|
||||||
|
type: string
|
||||||
|
description: The url where the events should be sent
|
||||||
|
subscriptions:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
enum: [
|
||||||
|
"conversation_created",
|
||||||
|
"conversation_status_changed",
|
||||||
|
"conversation_updated",
|
||||||
|
"message_created",
|
||||||
|
"message_updated",
|
||||||
|
"webwidget_triggered"
|
||||||
|
]
|
||||||
|
description: The events you want to subscribe to.
|
24
swagger/definitions/resource/webhook.yml
Normal file
24
swagger/definitions/resource/webhook.yml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: number
|
||||||
|
description: The ID of the webhook
|
||||||
|
url:
|
||||||
|
type: string
|
||||||
|
description: The url to which the events will be send
|
||||||
|
subscriptions:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
enum: [
|
||||||
|
"conversation_created",
|
||||||
|
"conversation_status_changed",
|
||||||
|
"conversation_updated",
|
||||||
|
"message_created",
|
||||||
|
"message_updated",
|
||||||
|
"webwidget_triggered"
|
||||||
|
]
|
||||||
|
description: The list of subscribed events
|
||||||
|
account_id:
|
||||||
|
type: number
|
||||||
|
description: The id of the account which the webhook object belongs to
|
|
@ -56,17 +56,18 @@ x-tagGroups:
|
||||||
- Agents
|
- Agents
|
||||||
- Canned Responses
|
- Canned Responses
|
||||||
- Contacts
|
- Contacts
|
||||||
- Conversations
|
|
||||||
- Conversation Assignment
|
- Conversation Assignment
|
||||||
- Conversation Labels
|
- Conversation Labels
|
||||||
- Inboxes
|
- Conversations
|
||||||
- Messages
|
|
||||||
- Integrations
|
|
||||||
- Profile
|
|
||||||
- Teams
|
|
||||||
- Custom Filters
|
|
||||||
- Reports
|
|
||||||
- Custom Attributes
|
- Custom Attributes
|
||||||
|
- Custom Filters
|
||||||
|
- Inboxes
|
||||||
|
- Integrations
|
||||||
|
- Messages
|
||||||
|
- Profile
|
||||||
|
- Reports
|
||||||
|
- Teams
|
||||||
|
- Webhooks
|
||||||
- name: Client
|
- name: Client
|
||||||
tags:
|
tags:
|
||||||
- Contacts API
|
- Contacts API
|
||||||
|
|
|
@ -25,6 +25,9 @@ conversation_id:
|
||||||
custom_filter_id:
|
custom_filter_id:
|
||||||
$ref: ./custom_filter_id.yml
|
$ref: ./custom_filter_id.yml
|
||||||
|
|
||||||
|
webhook_id:
|
||||||
|
$ref: ./webhook_id.yml
|
||||||
|
|
||||||
message_id:
|
message_id:
|
||||||
$ref: ./message_id.yml
|
$ref: ./message_id.yml
|
||||||
|
|
||||||
|
|
5
swagger/parameters/webhook_id.yml
Normal file
5
swagger/parameters/webhook_id.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
in: path
|
||||||
|
name: webhook_id
|
||||||
|
type: integer
|
||||||
|
required: true
|
||||||
|
description: The numeric ID of the webhook
|
19
swagger/paths/application/webhooks/create.yml
Normal file
19
swagger/paths/application/webhooks/create.yml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
tags:
|
||||||
|
- Webhooks
|
||||||
|
operationId: create-a-webhook
|
||||||
|
summary: Add a webhook
|
||||||
|
description: Add a webhook subscription to the account
|
||||||
|
parameters:
|
||||||
|
- $ref: '#/parameters/account_id'
|
||||||
|
- name: data
|
||||||
|
in: body
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/webhook_create_update_payload'
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Success
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/webhook'
|
||||||
|
401:
|
||||||
|
description: Unauthorized
|
12
swagger/paths/application/webhooks/delete.yml
Normal file
12
swagger/paths/application/webhooks/delete.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
tags:
|
||||||
|
- Webhooks
|
||||||
|
operationId: delete-a-webhook
|
||||||
|
summary: Delete a webhook
|
||||||
|
description: Delete a webhook from the account
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Success
|
||||||
|
401:
|
||||||
|
description: Unauthorized
|
||||||
|
404:
|
||||||
|
description: The webhook does not exist in the account
|
15
swagger/paths/application/webhooks/index.yml
Normal file
15
swagger/paths/application/webhooks/index.yml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
tags:
|
||||||
|
- Webhooks
|
||||||
|
operationId: list-all-webhooks
|
||||||
|
summary: List all webhooks
|
||||||
|
description: List all webhooks in the account
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Success
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
description: 'Array of webhook objects'
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/webhook'
|
||||||
|
401:
|
||||||
|
description: Unauthorized
|
19
swagger/paths/application/webhooks/update.yml
Normal file
19
swagger/paths/application/webhooks/update.yml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
tags:
|
||||||
|
- Webhooks
|
||||||
|
operationId: update-a-webhook
|
||||||
|
summary: Update a webhook object
|
||||||
|
description: Update a webhook object in the account
|
||||||
|
parameters:
|
||||||
|
- $ref: '#/parameters/account_id'
|
||||||
|
- name: data
|
||||||
|
in: body
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/webhook_create_update_payload'
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Success
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/webhook'
|
||||||
|
401:
|
||||||
|
description: Unauthorized
|
|
@ -385,6 +385,23 @@
|
||||||
delete:
|
delete:
|
||||||
$ref: ./application/custom_filters/delete.yml
|
$ref: ./application/custom_filters/delete.yml
|
||||||
|
|
||||||
|
# webhooks
|
||||||
|
/api/v1/accounts/{account_id}/webhooks:
|
||||||
|
parameters:
|
||||||
|
- $ref: '#/parameters/account_id'
|
||||||
|
get:
|
||||||
|
$ref: ./application/webhooks/index.yml
|
||||||
|
post:
|
||||||
|
$ref: ./application/webhooks/create.yml
|
||||||
|
/api/v1/accounts/{account_id}/webhooks/{webhook_id}:
|
||||||
|
parameters:
|
||||||
|
- $ref: '#/parameters/account_id'
|
||||||
|
- $ref: '#/parameters/webhook_id'
|
||||||
|
patch:
|
||||||
|
$ref: ./application/webhooks/update.yml
|
||||||
|
delete:
|
||||||
|
$ref: ./application/webhooks/delete.yml
|
||||||
|
|
||||||
### Reports
|
### Reports
|
||||||
|
|
||||||
# List
|
# List
|
||||||
|
|
|
@ -4081,6 +4081,129 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/api/v1/accounts/{account_id}/webhooks": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"$ref": "#/parameters/account_id"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"Webhooks"
|
||||||
|
],
|
||||||
|
"operationId": "list-all-webhooks",
|
||||||
|
"summary": "List all webhooks",
|
||||||
|
"description": "List all webhooks in the account",
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Success",
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"description": "Array of webhook objects",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/webhook"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "Unauthorized"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"post": {
|
||||||
|
"tags": [
|
||||||
|
"Webhooks"
|
||||||
|
],
|
||||||
|
"operationId": "create-a-webhook",
|
||||||
|
"summary": "Add a webhook",
|
||||||
|
"description": "Add a webhook subscription to the account",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"$ref": "#/parameters/account_id"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "data",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/webhook_create_update_payload"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Success",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/webhook"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "Unauthorized"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/v1/accounts/{account_id}/webhooks/{webhook_id}": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"$ref": "#/parameters/account_id"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/parameters/webhook_id"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"patch": {
|
||||||
|
"tags": [
|
||||||
|
"Webhooks"
|
||||||
|
],
|
||||||
|
"operationId": "update-a-webhook",
|
||||||
|
"summary": "Update a webhook object",
|
||||||
|
"description": "Update a webhook object in the account",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"$ref": "#/parameters/account_id"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "data",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/webhook_create_update_payload"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Success",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/webhook"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "Unauthorized"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"delete": {
|
||||||
|
"tags": [
|
||||||
|
"Webhooks"
|
||||||
|
],
|
||||||
|
"operationId": "delete-a-webhook",
|
||||||
|
"summary": "Delete a webhook",
|
||||||
|
"description": "Delete a webhook from the account",
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Success"
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "Unauthorized"
|
||||||
|
},
|
||||||
|
"404": {
|
||||||
|
"description": "The webhook does not exist in the account"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/api/v2/accounts/{account_id}/reports": {
|
"/api/v2/accounts/{account_id}/reports": {
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
|
@ -4772,6 +4895,38 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"webhook": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "The ID of the webhook"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The url to which the events will be send"
|
||||||
|
},
|
||||||
|
"subscriptions": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"conversation_created",
|
||||||
|
"conversation_status_changed",
|
||||||
|
"conversation_updated",
|
||||||
|
"message_created",
|
||||||
|
"message_updated",
|
||||||
|
"webwidget_triggered"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"description": "The list of subscribed events"
|
||||||
|
},
|
||||||
|
"account_id": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "The id of the account which the webhook object belongs to"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"account": {
|
"account": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -5223,6 +5378,30 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"webhook_create_update_payload": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The url where the events should be sent"
|
||||||
|
},
|
||||||
|
"subscriptions": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"conversation_created",
|
||||||
|
"conversation_status_changed",
|
||||||
|
"conversation_updated",
|
||||||
|
"message_created",
|
||||||
|
"message_updated",
|
||||||
|
"webwidget_triggered"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"description": "The events you want to subscribe to."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"integrations_hook_create_payload": {
|
"integrations_hook_create_payload": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -5736,6 +5915,13 @@
|
||||||
"required": true,
|
"required": true,
|
||||||
"description": "The numeric ID of the custom filter"
|
"description": "The numeric ID of the custom filter"
|
||||||
},
|
},
|
||||||
|
"webhook_id": {
|
||||||
|
"in": "path",
|
||||||
|
"name": "webhook_id",
|
||||||
|
"type": "integer",
|
||||||
|
"required": true,
|
||||||
|
"description": "The numeric ID of the webhook"
|
||||||
|
},
|
||||||
"message_id": {
|
"message_id": {
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"name": "message_id",
|
"name": "message_id",
|
||||||
|
@ -5819,17 +6005,18 @@
|
||||||
"Agents",
|
"Agents",
|
||||||
"Canned Responses",
|
"Canned Responses",
|
||||||
"Contacts",
|
"Contacts",
|
||||||
"Conversations",
|
|
||||||
"Conversation Assignment",
|
"Conversation Assignment",
|
||||||
"Conversation Labels",
|
"Conversation Labels",
|
||||||
"Inboxes",
|
"Conversations",
|
||||||
"Messages",
|
"Custom Attributes",
|
||||||
"Integrations",
|
|
||||||
"Profile",
|
|
||||||
"Teams",
|
|
||||||
"Custom Filters",
|
"Custom Filters",
|
||||||
|
"Inboxes",
|
||||||
|
"Integrations",
|
||||||
|
"Messages",
|
||||||
|
"Profile",
|
||||||
"Reports",
|
"Reports",
|
||||||
"Custom Attributes"
|
"Teams",
|
||||||
|
"Webhooks"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue