Creating Webhooks

Creating a Webhook

Wix Answers enables you to configure webhooks in your account for certain events, like when a ticket is created or when a customer replies to a ticket. When triggered, Wix Answers sends a POST request to the webhook URL that you've defined. 
Automatic Actions Do Not Trigger Webhooks
Please note that automatic actions do not trigger webhooks.
For chat-related webhooks, see Chat-Related Webhooks.

To create a webhook:

  1. In the Wix Answers app, go to Settings > Tools > Webhooks & API Keys.
  1. Click Add Webhook
  2. Create a new webhook:
    1. Enter a name for your webhook. 
    2. Enter a URL to where the POST requests are sent. This URL should be configured to take an action based on the data that is posted to it by the webhook.
    3. Click the drop-down and choose an action to trigger the event (see next section for details):
      • Agent Reply Created / Reply Created- Triggered after an agent / user creates a reply.
      • Article Sent to Translation - Triggered when an article translation task is created. An article translation task is created by default when an article translation is created.
      • Chat Ended - Triggered when a chat ends.
      • Call Ended - Triggered when a call ends.
      • Company Created / Company Updated / Company Deleted - Triggered when the relevant change is made to a company.
      • Customer Created or Updated - Triggered when a user is created or modified.
      • Customer Satisfaction Survey Submitted - Triggered when a user submits a CSAT response.
      • Internal Note Created - Triggered after an agent adds an internal note.
      • SSO Outdated - Triggered after a user's email address is updated automatically and this results in a conflict: a non-unique email address. Email addresses must be unique in Wix Answers. This webhook is relevant only for accounts that are configured using SSO login.
      • Ticket Created - Triggered after a ticket is created.
      • Ticket Transferred - Triggered after an agent transfers a ticket to another user.
      • Ticket Status Changed - Triggered after the status changes to Closed or Solved for one or more tickets.
Available Webhooks
If one of the above webhooks is not available in your tenant, contact Wix Answers customer support to enable it.

Webhook Types

This section presents more information about each webhook, including payloads for the webhook types.

Ticket Created Webhook

Triggered after a ticket is created. For more details about the webhook body, see the Ticket object.

content-type: application/json; charset=utf-8

Example JSON of posted data sent when a ticket is created:
1
2
3
4
{
  "payload": { @Ticket object },
  "url": "https://your.endpoint/for/webhook"
}

Ticket Transferred Webhook

Triggered after an agent transfers a ticket. An agent typically transfers a ticket from an unauthenticated user to an authenticated user once the user's ID is known.
For more details about the webhook body, see the Ticket object. The User object contains information about the new user.

content-type: application/json; charset=utf-8

Example JSON of posted data sent when a ticket is transferred:
1
2
3
4
{
  "payload": { @Ticket object },
  "url": "https://your.endpoint/for/webhook"
}

Ticket Status Changed Webhook

Triggered after a ticket's status is changed to Closed or Solved. For more details about the webhook body, see the Ticket object. The User object contains information about the new user.

content-type: application/json; charset=utf-8

Example JSON of posted data sent when one or more tickets' statuses change:
1
2
3
4
5
6
7
8
9
10
11
{
 "payload": [
  {
   "ticket": { @Ticket object (with new status) },
   "oldStatus": 110
  },
        ... additional structures if there are other tickets with new
            statuses ...
 ],
 "url": "https://your.endpoint/for/webhook"
}

Agent Reply Created / Reply Created Webhook

The relevant webhook is triggered when an agent (Agent Reply Created) or user (Reply Created) replies to a ticket. The Agent Reply Created webhook does not trigger for internal notes (see Internal Note Created Webhook).

The Ticket object, together with the Reply object, is sent as payload. For more details, see Ticket object and Reply object.

content-type: application/json; charset=utf-8

Example JSON of posted data sent when a reply is created:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "payload": {
    "content": "<div>Here is more information.</div>\n\n",
    "user": { @User object },
    "channel": 110,
    "creationDate": 1530091629935,
    "lastUpdateDate": 1530091629935,
    "id": "ce9d108a-f90a-48ec-8843-e93e97db04ff",
    "type": 100,
    "parentTicket": { @Ticket object },
    "channelData": {
      "mailboxId": "e9cb4871-e80b-4969-ab83-3268c8d8ee86",
      "mailboxEmail": "support.your-name-test@in.wixanswers.com"
    }
  },
  "url": "https://your.endpoint/for/webhook"
}

Internal Note Created Webhook

Triggered when an agent adds an internal note. The Ticket Object, together with the Reply object, is sent as payload. For more details, see Ticket object and Reply object.

content-type: application/json; charset=utf-8

Example JSON of posted data sent when an internal note is created:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "payload": {
    "content": "<div>Here is more information.</div>\n\n",
    "user": { @User object },
    "channel": 110,
    "creationDate": 1530091629935,
    "lastUpdateDate": 1530091629935,
    "id": "ce9d108a-f90a-48ec-8843-e93e97db04ff",
    "type": 100,
    "parentTicket": { @Ticket object },
    "channelData": {
      "mailboxId": "e9cb4871-e80b-4969-ab83-3268c8d8ee86",
      "mailboxEmail": "support.your-name-test@in.wixanswers.com"
    }
  },
  "url": "https://your.endpoint/for/webhook"
}

SSO User Outdated Webhook

This webhook is relevant only for accounts that are configured using SSO login.

When a user's email address changes in the external user system, and that user logs into Wix Answers, then the user's email address in Wix Answers is automatically updated to align with the external system. A change like this can cause email conflicts in Wix Answers, because user emails must be unique for each Wix Answers account. If a conflict occurs, Wix Answers triggers this webhook to allow the external user system to resolve the conflict by performing a return API request to Wix Answers to update the user's conflicting email.

The User object is sent as a payload. For more details, see User object.

content-type: application/json; charset=utf-8

Example JSON of posted data sent when user's SSO email is outdated:
1
2
3
4
{
  "payload": { @User object },
  "url": "https://your.endpoint/for/webhook"
}

Chat Ended Webhook

Triggered when a chat ends. The payload contains the Ticket object, Chat object, and the User object of the user that ended the chat.

content-type: application/json; charset=utf-8

Example JSON of posted data sent when a chat ends:
1
2
3
4
5
6
7
8
9
10
11
12
{
 "payload": {
  "ticket": { @Ticket object },
  "chat": { @Chat object },
  "endedBy": { @User object },
  "userMessageCount": 2,
  "agentMessageCount": 3,
  "userBatchesCount": 2,
  "agentBatchesCount": 3
 },
 "url": "https://your.endpoint/for/webhook"
}

Call Ended Webhook

Triggered when a phone call ends or is transferred to an external number (away from Wix Answers). The payload includes the Ticket object and the Call object.

content-type: application/json; charset=utf-8

Example JSON of posted data sent when a phone call ends:
1
2
3
4
5
6
7
{
 "payload": {
  "ticket": { @Ticket object },
  "phoneCall": { @Call object }
 },
 "url": "https://your.endpoint/for/webhook"
}

Customer Created or Updated Webhook

Triggered when a user is created or modified (email, name, and so forth). The payload includes fields of the new user (newUser) or both the old information (oldUser) and the new information (newUser) of the user. The fields include:
  • id
  • email
  • emailStatus
  • creationDate
  • lastUpdateDate
  • externalId
  • userType
  • firstName
  • lastName
  • phoneNumbers
  • company
  • customFields
  • banned
For information about these fields, see User object.

content-type: application/json; charset=utf-8

Example JSON of posted data sent when a user is modified:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
  "payload": {
    "oldUser": {
      "id": "3c082d93-0f8b-40ee-bc8a-d77885f2e38b",
      "email": "3c082d93-0f8b-40ee-bc8a-d77885f2e38b@wixanswersmail.com",
      "emailStatus": 0,
      "creationDate": 1580729856000,
      "lastUpdateDate": 1580730613000,
      "userType": 2,
      "firstName": "John",
      "lastName": "Smith",
      "banned": false
    },
    "newUser": {
      "id": "3c082d93-0f8b-40ee-bc8a-d77885f2e38b",
      "email": "3c082d93-0f8b-40ee-bc8a-d77885f2e38b@wixanswersmail.com",
      "emailStatus": 0,
      "creationDate": 1580729856000,
      "lastUpdateDate": 1580730661000,
      "userType": 2,
      "firstName": "Jane",
      "lastName": "Smith",
      "banned": false
    },
  },
  "url": "https://your.endpoint/for/webhook"
}

Article Sent to Translation Webhook

Triggered when your site supports additional languages and an agent sends an article to be translated into one or more languages (locales). The payload includes the Article object and the requested language(s).

content-type: application/json; charset=utf-8

Example JSON of posted data sent when an article is sent for translation:
1
2
3
4
5
6
7
8
9
10
11
12
13
{
  "payload": {
    "articles": [ { @Article object } ],
    "translationsLocales": [
      locale,
      locale,
       ...
      ]
  },
  "url": "https://your.endpoint/for/webhook"
}

// locale examples: "fr", "de", ...

Company Created / Company Updated / Company Deleted Webhook

The relevant webhook is triggered when you create / update / or delete a company. Each payload includes the Company object.

content-type: application/json; charset=utf-8

Example JSON of posted data when a company is created or deleted:
1
2
3
4
5
6
{
  "payload": {
    @Company object
  },
  "url": "https://your.endpoint/for/webhook"
}
Example JSON of posted data when a company is updated:
1
2
3
4
5
6
7
8
9
10
11
{
  "payload": {
    "oldCompany": {
      @Company object
    }
    "newCompany": {
      @Company object
    }
  },
  "url": "https://your.endpoint/for/webhook"
}

Customer Satisfaction Survey Submitted Webook

Triggered when Wix Answers receives a response to a customer satisfaction (CSAT) survey. The payload includes the CSAT object.

content-type: application/json; charset=utf-8

Example JSON of posted data sent when a CSAT response is received:
1
2
3
4
5
6
{
  "payload": {
    @CSAT object
  },
  "url": "https://your.endpoint/for/webhook"
}