Webhook
- 16 Jun 2022
- 1 Minute to read
- Print
- DarkLight
Webhook
- Updated on 16 Jun 2022
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Webhook
You need the Manage Integration permission to manage Webhook.
Webhooks
- Webhooks ManageGET livechat/webhooks
- Get the list of WebhooksGET livechat/webhooks/{id}
- Get a single WebhookPOST livechat/webhooks
- Create a new WebhookPUT livechat/webhooks/{id}
- Update the WebhookDELETE livechat/webhooks/{id}
- Remove the Webhook
Webhook JSON Format
Webhook is represented as simple flat JSON objects with the following keys:
Name | Type | Description |
---|---|---|
id | guid | Id of the webhook. |
event | string | Allowed values are "offlineMessageIsSubmitted", "chatStarts", "chatEnds", "chatIsWrappedUp", "agentStatusChanges", "chatIsRequested", "chatIsTransferred". |
targetUrl | string | Target url of the webhook. |
Get the list of Webhooks
GET livechat/webhooks
Parameters:
No Parameters
Response:
An array of Webhook
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/webhooks \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 200 OK
[
{
"id": "69FAB2B6-1189-4B96-BD06-1CBDADBC1164",
"event": "chatStarts",
"targetUrl": "http://www.google.com"
}
]
Get a single Webhook
GET livechat/webhooks/{id}
Parameters:
No Parameters
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/webhooks/69FAB2B6-1189-4B96-BD06-1CBDADBC1164 \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 200 OK
{
"id": "69FAB2B6-1189-4B96-BD06-1CBDADBC1164",
"event": "chatStarts",
"targetUrl": "http://www.google.com"
}
Create a new Webhook
POST livechat/webhooks
Parameters:
Name | Type | in | Required | Description |
---|---|---|---|---|
event | string | body | yes | Allowed values are "offlineMessageIsSubmitted", "chatStarts", "chatEnds", "chatIsWrappedUp", "agentStatusChanges", "chatIsRequested", "chatIsTransferred". |
targetUrl | string | body | yes | Target url of the webhook. |
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/webhooks \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"event":"chatStarts","targetUrl":"http://www.google.com"}'
Response:
HTTP/1.1 201 Created
{
"id": "69FAB2B6-1189-4B96-BD06-1CBDADBC1164",
"event": "chatStarts",
"targetUrl": "http://www.google.com"
}
Update the Webhook
PUT livechat/webhooks/{id}
Parameters:
Name | Type | in | Required | Description |
---|---|---|---|---|
event | string | body | yes | Allowed values are "offlineMessageIsSubmitted", "chatStarts", "chatEnds", "chatIsWrappedUp", "agentStatusChanges", "chatIsRequested", "chatIsTransferred". |
targetUrl | string | body | yes | Target url of the webhook. |
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/webhooks/69FAB2B6-1189-4B96-BD06-1CBDADBC1164 \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"event":"chatStarts","targetUrl":"http://www.google.com"}'
Response:
HTTP/1.1 200 OK
{
"id": "69FAB2B6-1189-4B96-BD06-1CBDADBC1164",
"event": "chatStarts",
"targetUrl": "http://www.google.com"
}
Remove the Webhook
DELETE livechat/webhooks/{id}
Parameters:
No Parameters
Response:
No Content
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/webhooks/69FAB2B6-1189-4B96-BD06-1CBDADBC1164 \
-X 'DELETE' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 204 No Content
Was this article helpful?