Webhook
The Webhook is a event notification system that are ableto capture the actions in Huggy Platform and forward directly to your system. You can be notified about:
- Opening and closure of chats
- Contacts creation
- Received messages of your customers/contacts
- Received platforms entities messages, like bots, URA, or agents;
If you'd like to receive notifications from our webhook on your system, visit how to use Webhook and learn more.
To receive the notifications, you need to set up a notification URL in the Huggy panel, and the desired events must be enabled to be triggered in your webhook settings.
The webhook events available are listed below. All events are optional and can be selected in Huggy platform, therefore, select those who are more relevant for the experience that you are trying to create.
Notifications
Event of notification | Description |
---|---|
receivedMessage | Received messages on platform the webhook will notify events of chats that are in automatic or queue |
receivedAllMessage | Get all messages received by a chat contact |
createdChat | When a chat is created by any channel |
agentEntered | When the agent joins the conversation |
closedChat | When a chat ends |
answeredChatForm | Depreciated |
createdCustomer | When a new contact is created in the Huggy panel |
startedWidgetAttendance | Started when data request is enabled in Huggy Chat. This event is started when the customer inform the data and initialize the attendance |
startedAutomationFlow | When a chat is initialized in a channel that are using a flow |
finishedAutomationFlow | When a flow that was executing in a chat are finalized |
sendedAllMessage | All messages sent by an agent |
updatedWorkflowStep | When there is a change in the workflow step of the chat |
Received messages on platform the webhook will notify events of chats that are in automatic or queue
Depreciated
Started when data request is enabled in Huggy Chat. This event is started when the customer inform the data and initialize the attendance
Note: An event is returned like a Message List. When a specific event is sent to your system, it can brings other events belonging to the chain events in addition to the event data. This indicates that between an action and its completion, other events can be or not be triggered.
Variations on events
- If exists an input and/or output flow
- Type received messages
Intelligent layer:
receivedMessage (when a chat its in automatic or in queue).Human layer:
receivedMessage; receivedALLMessage.
- If some flow interaction exists to close a chat.
Some notification examples
Action | Notification | Note |
---|---|---|
Chat creation | createdChat | 1. Created by an agent. It doesn’t have interaction with a flow. |
Chat creation | createdChat, receivedAllMessage | 1. The customer creates a new attendance and sent a message to the chat. 2. After creation there is flow interaction. |
Chat creation | createdChat, receivedAllMessage, startedAutomationFlow | 1. The customer create a new chat. 2. The customer sends a message. 3. A flow was initialized in the chat. |
Chat finished | startedAutomationFlow, receivedAllMessage, finishedAutomationFlow, closedChat | 1. An output flow with a feedback action is executed. 2. The customer answers the feedback. 3. The chat is closed. |
Chat finished | sendedAllMessage, closedChat | 1. An agent informs to a client that the chat will be closed. 2. A tabulation is set when this chat is closed. 3. The chat is closed. |
Chat finished | agentEntered, closedChat | 1. An agent ensters in a chat (taking it from the queue, for example). 2. The chat is closed. |
createdChat
Exemplo: 1. Created by an agent. It doesn’t have interaction with a flow.
createdChat, receivedAllMessage
Exemplo: 1. The customer creates a new attendance and sent a message to the chat. 2. After creation there is flow interaction.
createdChat, receivedAllMessage, startedAutomationFlow
Exemplo: 1. The customer create a new chat. 2. The customer sends a message. 3. A flow was initialized in the chat.
startedAutomationFlow, receivedAllMessage, finishedAutomationFlow, closedChat
Exemplo: 1. An output flow with a feedback action is executed. 2. The customer answers the feedback. 3. The chat is closed.
sendedAllMessage, closedChat
Exemplo: 1. An agent informs to a client that the chat will be closed. 2. A tabulation is set when this chat is closed. 3. The chat is closed.
agentEntered, closedChat
Exemplo: 1. An agent ensters in a chat (taking it from the queue, for example). 2. The chat is closed.
Note: Consider that the events only will be notified if they were marked in the webhook settings of Huggy platform.
Understanding the Event Format
Notice that messages
is an array and can contain various objects.
{
"time": 1562964573,
"messages": {
"createdChat": [
{
"id": 19632057,
"channel": "widget",
"situation": null,
"department": false,
"customer": {
"id": 2574725,
"name": "L8883851555530376861",
"mobile": null,
"phone": null,
"email": null,
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"company": {
"id": "15691"
}
}
],
"receivedMessage": [
{
"id": "424921135",
"body": "Hello, Kivya!",
"is_internal": false,
"is_email": false,
"sender": {
"id": 2574725,
"name": "L8883851555530376861",
"mobile": null,
"phone": null,
"email": null,
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"senderType": "widget",
"receiver": false,
"receiverType": "agent",
"file": null,
"channel": "widget",
"customer": {
"id": 2574725,
"name": "L8883851555530376861",
"mobile": null,
"phone": null,
"email": null,
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"chat": {
"id": 19632057,
"channel": "widget",
"situation": "auto",
"department": false,
"customer": {
"id": 2574725,
"name": "L8883851555530376861",
"mobile": null,
"phone": null,
"email": null,
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
}
},
"send_at": "2019-07-12 17:49:33",
"read_at": null,
"company": {
"id": "15691"
}
}
]
},
"token": "8187ce0c2e5d0aefd626fa4999f62974"
}
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Note: This action was executed with the receivedAllMessages event disabled in Huggy platform. If this event was selected, you would receive the notifications of
createdChat
,receivedAllMessage
,receivedMessage
. The chat is only created when the customer sends the first message or when an agent opens a chat with a customer, but in this case only thecreatedChat
and thereceivedMessage
events are triggered. ThereceivedAllMessage
is started regardless of being automatic messages.
Event Properties
Properties | Type | Description |
---|---|---|
time | integer | coming soon |
messages | array[Message] | An array that return webhook events. |
createdChat | CreatedChat | Contains data of creating chat |
receivedMessage | ReceivedMessage | Contains data of received message |
token | string | coming soon |
Exemplo: coming soon
Exemplo: coming soon
createdChat
Properties | Type | Description |
---|---|---|
id | integer | Chat itendifier number |
channel | string | Channel that the customer has contacted |
situation | string | In attendance, in queue, finalized etc |
department | string | Chat department |
customer | Customer | Data customer |
company | Company | Data customer |
Customer
Properties | Type | Description |
---|---|---|
id | integer | Chat itendifier number |
name | string | Contact name |
mobile | string | Contact mobile |
phone | string | Contact phone |
string | Contact email | |
photo | string | Contact photo |
Exemplo: Chat itendifier number
Exemplo: Contact name
Exemplo: Contact mobile
Exemplo: Contact phone
Exemplo: Contact email
Exemplo: Contact photo
Company
Properties | Type | Description |
---|---|---|
id | integer | Company ID that the chat was create |
Company ID that the chat was create
receivedMessage
Properties | Type | Description |
---|---|---|
id | integer | Contact ID |
body | string | Message sent by customer |
is_internal | string | If the message was sent to an internal chat |
is_email | string | If the message was received by email |
sender | Sender | message sender data |
senderType | string | Channel that the customer has contacted |
receiver | string | Contact name |
receiverType | string | Type of person that receiving the message. For example: Agent, Contact. |
file | string | If was sent some file. |
channel | string | Used channel. |
customer | Customer | Customer data. |
chat | Chat | Data chat information. |
send_at | string | Received message date. |
read_at | string | Last reading date. |
Exemplo: Contact ID
Exemplo: Message sent by customer
Exemplo: If the message was sent to an internal chat
Exemplo: If the message was received by email
Exemplo: Channel that the customer has contacted
Exemplo: Contact name
Exemplo: Type of person that receiving the message. For example: Agent, Contact.
Exemplo: If was sent some file.
Exemplo: Used channel.
Exemplo: Received message date.
Exemplo: Last reading date.
Sender
Properties | Type | Description |
---|---|---|
id | integer | Contact ID |
name | string | Contact name |
mobile | string | Contact mobile |
phone | string | Contact phone |
string | Contact email | |
photo | string | Contact profile photo URL address |
Exemplo: Contact ID
Exemplo: Contact name
Exemplo: Contact mobile
Exemplo: Contact phone
Exemplo: Contact email
Exemplo: Contact profile photo URL address
Chat
Properties | Type | Description |
---|---|---|
id | integer | Contact ID |
channel | string | Channel name |
situation | string | If the chat is in attendance, in queue, finalized, etc. |
department | string | Channel department number. |
customer | Customer | Customer data. |
Exemplo: Contact ID
Exemplo: Channel name
Exemplo: If the chat is in attendance, in queue, finalized, etc.
Exemplo: Channel department number.
Example of received message
The receivedAllMessage
event, in this example, is an event notified by the action of sending a message. The customer contacted the Kivya agent by Huggy Chat. There’s no automated events that happen after the customer contacts.
{
"time": 1562879079,
"messages": {
"receivedAllMessage": [{
"id": "423747203",
"body": "Hello Kivya, how are you?",
"is_internal": false,
"is_email": false,
"sender": {
"id": 2574725,
"name": "L8883851555530376861",
"mobile": null,
"phone": null,
"email": null,
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"senderType": "widget",
"receiver": {
"id": 39708,
"name": "Kivya",
"mobile": "5575999999999",
"phone": "5575999999999",
"email": "kivya@test.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"receiverType": "agent",
"file": null,
"channel": "widget",
"customer": {
"id": 2574725,
"name": "L8883851555530376861",
"mobile": null,
"phone": null,
"email": null,
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"chat": {
"id": 19585255,
"channel": "widget",
"situation": "in_chat",
"department": false,
"customer": {
"id": 2574725,
"name": "L8883851555530376861",
"mobile": null,
"phone": null,
"email": null,
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
}
},
"send_at": "2019-07-11 18:04:39",
"read_at": null,
"company": {
"id": "15691"
}
}]
},
"token": "8817ce0c2e5d0aefd626fa4989f63974"
}
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
To improve your event browsing experience, you can click in any event above, or click on title of any event for back to the event lists.
receivedMessage
Received message notification
Huggy sends a notification to your system whenever a message is received.
{
"time": 1524155854,
"messages": {
"receivedMessage": [
{
"id": "51917884",
"body": "teste",
"is_internal": false,
"is_email": false,
"sender": {
"id": 419689,
"name": "Charles",
"mobile": "557599999999",
"phone": "557599999999",
"email": "charles@teste.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"senderType": "widget",
"receiver": false,
"receiverType": "agent",
"file": null,
"channel": "widget",
"customer": {
"id": 419689,
"name": "Charles",
"mobile": "557599999999",
"phone": "557533333333",
"email": "charles@teste.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"chat": {
"id": 2932424,
"channel": "widget",
"situation": "wait_for_chat",
"department": 11445
},
"send_at": "2018-04-19 13:37:34",
"read_at": null,
"company": {
"id": "6618"
}
}
]
},
"token": "132ce76c7abb1154f01ebc0d508162e4"
}
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Note: You will by communicated with a receivedMessage event when a chat is in queue or in automatic. If an agent queues a chat and you are notified with a event agentEntered, the option of automatic distribution will be enabled in panel. For clearer experience with webhook, make sure of this.
receivedAllMessage
Notification of all messages received and/or sent
Huggy sends a notification to your system whenever a message is received. Unlike the receivedMessage
event, this event will be started regardless if the message is automatic (Bot, URA…) or no (from customer/agents).
{
"time": 1524146026,
"messages": {
"receivedAllMessage": [
{
"id": "51917874",
"body": "I!",
"is_internal": false,
"is_email": false,
"sender": {
"id": 419688,
"name": "Johann",
"mobile": "557599999999",
"phone": "557533333333",
"email": "johann@test.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"senderType": "widget",
"receiver": {
"id": 8792,
"name": "Kivya Aguiar",
"mobile": "557533333333",
"phone": "557599999999",
"email": "kivya@teste.com",
"photo": "https://cdn.pzw.io/03a3e95e84ccd5f19140ce6db54f71f1.jpg"
},
"receiverType": "agent",
"file": null,
"channel": "widget",
"customer": {
"id": 419688,
"name": "Johann",
"mobile": "557599999999",
"phone": "557533333333",
"email": "johann@test.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"chat": {
"id": 2932423,
"channel": "widget",
"situation": "in_chat",
"department": 11445
},
"send_at": "2018-04-19 10:53:45",
"read_at": null,
"company": {
"id": "9999"
}
}
]
},
"token": "132ce76c7abb1154f01ebc0d508162e4"
}
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
createdChat
Attendance opening notification
Huggy send a notification to your system whenever a chat is created.
{
"time":1501188213,
"messages":{
"createdChat": [{
"id": 999999,
"channel": "widget",
"situation": null,
"department": false
}],
"token":"16f64ecc76487a909e278766071b4da8"
}
}
2
3
4
5
6
7
8
9
10
11
12
agentEntered
Agent entry notification to chat
Huggy sends a notification to your system whenever an agent is added to a conversation.
{
"time": 1583439114,
"messages": {
"agentEntered": [
{
"id": 30608118,
"channel": "email",
"situation": "in_chat",
"department": false,
"customer": {
"id": 8341726,
"name": "Charles Edward",
"mobile": "75999999999",
"phone": "7533333333",
"email": "edward@teste.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"agent": {
"id": 40419,
"name": "John Doe",
"mobile": "5575999999999",
"phone": "5575999999999",
"email": "john@doe.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"company": {
"id": "15691"
}
}
]
},
"token": "8817ce0c2e5d0aefd626fa4999f62974"
}
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
28
29
30
31
32
33
closedChat
Chat notification ended
Huggy sends a notification to your system whenever a chat ends.
{
"time": 1583439671,
"messages": {
"closedChat": [
{
"id": 30608118,
"channel": "email",
"closed_at": "2020-03-05 17:21:10",
"tabulation": false,
"situation": "finishing",
"closed": 1,
"company": {
"id": "15691"
}
}
]
},
"token": "8817ce0c2e5d0aefd626fa4999f62974"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
createdCustomer
Contact creation notification
Huggy sends a notification to your system whenever a new contact (Customer) is created.
{
"time": 1524151261,
"messages": {
"createdCustomer": [
{
"id": 1202213,
"name": "John Doe",
"mobile": "5575999999999",
"phone": "557533333333",
"email": "john@doe.com",
"photo": "no_photo",
"company": {
"id": "9999"
}
}
]
},
"token": "132ce76c7abb1154f01ebc0d5081xxxx"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
startedWidgetAttendance
Notification of new event by Huggy Chat
Huggy sends a notification to your system whenever an attendance is created by Huggy Chat.
{
"time": 1524151902,
"messages": {
"startedWidgetAttendance": [
{
"id": 18516008,
"name": "Charles",
"mobile": "557599999999",
"phone": "557533333333",
"email": "charles@teste.com",
"widget": "2008",
"company": {
"id": "9999"
}
}
]
},
"token": "132ce76c7abb1154f01ebc0d508162e4"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
startedAutomationFlow
Notification that flow has started
Huggy sends a notification to your system whenever a flow is initialized.
{
"time": 1530109996,
"messages": {
"startedAutomationFlow": [
{
"chatID": 99999,
"lastActionID": 99999,
"companyID": "99999",
"flowID": 99999,
"context": {
"SYSTEM.TIME_HELLO": "Good Morning",
"SYSTEM.CHAT_ID": "99999",
"SYSTEM.DEPARTMENT_NAME": "",
"SYSTEM.DEPARTMENT_ORDER": "",
"SYSTEM.CLIENT_NAME": "",
"SYSTEM.CLIENT_FIRST_NAME": "",
"SYSTEM.CLIENT_SECOND_NAME": "",
"SYSTEM.CLIENT_NUMBER": "",
"SYSTEM.COMPANY_NAME": "Test",
"SYSTEM.COMPANY_NUMBER": "9999999999",
"SYSTEM.AGENT_NAME": "",
"SYSTEM.AGENT_MAIL": "",
"SYSTEM.AGENT_PHONE": ""
},
"company": {
"id": "99999"
}
}
]
},
"token": "871457dcsvffe7d7d4177e47fr4d4sd74"
}
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
28
29
30
31
32
finishedAutomationFlow
Flow notification finalized
Huggy sends a notification to your system whenever a flow is finalized.
{
"time": 1530110012,
"messages": {
"finishedAutomationFlow": [
{
"chatID": 99999,
"lastActionID": 99999,
"companyID": "99999",
"flowID": 99999,
"context": {
"SYSTEM.TIME_HELLO": "bom dia",
"SYSTEM.CHAT_ID": "99999",
"SYSTEM.DEPARTMENT_NAME": "",
"SYSTEM.DEPARTMENT_ORDER": "",
"SYSTEM.CLIENT_NAME": "",
"SYSTEM.CLIENT_FIRST_NAME": "",
"SYSTEM.CLIENT_SECOND_NAME": "",
"SYSTEM.CLIENT_NUMBER": "",
"SYSTEM.COMPANY_NAME": "Teste",
"SYSTEM.COMPANY_NUMBER": "9999999999",
"SYSTEM.AGENT_NAME": "",
"SYSTEM.AGENT_MAIL": "",
"SYSTEM.AGENT_PHONE": "",
"hash_fluxo.pergunta": "Response"
},
"company": {
"id": "99999"
}
}
]
},
"token": "871458dcsvffe7d7d4177e47fr4d4sd74"
}
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
28
29
30
31
32
33
sendedAllMessage
Notification of message send by Huggy platform
Huggy sends a notification to your system whenever a message is sent by an agent of your company.
{
"time": 1563279612,
"messages": {
"sendedAllMessage": [
{
"id": "270925787",
"body": "Yes, let's go!",
"is_internal": false,
"is_email": false,
"sender": {
"id": 33980,
"name": "Amanda Muniz",
"mobile": "557599999999",
"phone": "557533333333",
"email": "Amanda@test.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"senderType": "agent",
"receiver": {
"id": 1841823,
"name": "John",
"mobile": "557599999999",
"phone": "557533333333",
"email": "john@doe.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"receiverType": "widget",
"file": null,
"channel": "agent",
"customer": {
"id": 1841823,
"name": "john",
"mobile": "557599999999",
"phone": "557533333333",
"email": "john@doe.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"chat": {
"id": 13120639,
"channel": "widget",
"situation": "in_chat",
"department": false,
"customer": {
"id": 1841823,
"name": "john",
"mobile": "557599999999",
"phone": "557533333333",
"email": "john@doe.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
}
},
"send_at": "2019-07-16 09:20:11",
"read_at": null,
"company": {
"id": "11721"
}
}
]
},
"token": "af0adcc862a9343c1d44e24cbdc0194c"
}
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
updatedWorkflowStep
Notification of changes in the workflow step
Huggy sends a notification to your system whenever there are changes in the workflow step of the chat.
{
"time": 1612806064,
"messages": {
"updatedWorkflowStep": [
{
"agent": {
"id": 40419,
"name": "John Doe",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"chat": {
"id": 31155221,
"channel": "widget",
"situation": "in_chat",
"department": false,
"customer": {
"id": 4362755,
"name": "L4732015503367501516",
"mobile": null,
"phone": null,
"email": null,
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"workflowID": 6074,
"workflowStepID": 7611
},
"step": {
"id": 7611,
"name": "etapa 2",
"workflow": {
"id": 6074,
"name": "Workflow of test"
}
},
"previousStep": {
"id": 7610,
"name": "etapa 1",
"workflow": {
"id": 6074,
"name": "Workflow of test"
}
},
"company": {
"id": 11721
}
}
]
},
"token": "9aee897289bd0576d6e49adf97dad96c"
}
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
← API v3 Webhook SMS →