Webhook
  • 16 Jun 2022
  • 1 Minute to read
  • Dark
    Light

Webhook

  • Dark
    Light

Article summary

Webhook

You need the Manage Integration permission to manage Webhook.

Webhook JSON Format

Webhook is represented as simple flat JSON objects with the following keys:

NameTypeDescription
idguidId of the webhook.
eventstringAllowed values are "offlineMessageIsSubmitted", "chatStarts", "chatEnds", "chatIsWrappedUp", "agentStatusChanges", "chatIsRequested", "chatIsTransferred".
targetUrlstringTarget 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:

Webhook

  • 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:

NameTypeinRequiredDescription
eventstringbodyyesAllowed values are "offlineMessageIsSubmitted", "chatStarts", "chatEnds", "chatIsWrappedUp", "agentStatusChanges", "chatIsRequested", "chatIsTransferred".
targetUrlstringbodyyesTarget url of the webhook.
  • Response:

Webhook

  • 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:

NameTypeinRequiredDescription
eventstringbodyyesAllowed values are "offlineMessageIsSubmitted", "chatStarts", "chatEnds", "chatIsWrappedUp", "agentStatusChanges", "chatIsRequested", "chatIsTransferred".
targetUrlstringbodyyesTarget url of the webhook.
  • Response:

Webhook

  • 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?