API v3
Welcome to the Huggy API. With it, you can manage all agents, contacts and serve your customers, send and receive messages. This API allows you to programmatically perform actions on your company account.
Our API natively supports the format:
REST
The system should make a request for the URL https://api.huggy.app/v3, sending the parameters by GET, POST, PUT or DELETE. For each request, the response will be a JSON object, which is detailed throughout this documentation.
Authentication
Authentication through Huggy Panel
For the API activation, you must have to activate the default company app in Developers section in Huggy platform and do the authentication through a authorization structure for get the API, OAuth2.0
. The Authentication through Huggy Panel the app activation gives automatic access for the oauth credentials, that are a client_id and a client_secret, that will be used to extract your account token.
App sections
Basic Informations
In this section, you can put a
Name
and a Description
for the app, both can be updated at any time.
OAuth 2.0 Authentication
In this section you can set up a callback URL. You also can view the client_id
and the client_secret
, that was generated automatically when you created the app in Huggy platform.
Redirect URL
callback url
- Consists in a url that the Huggy platform will return to your app the requested authorization.
OAuth credentials
client_id
- It’s the way that the Huggy API will be identify your app.
client_secret
- It’s known and used only by the app and the authorization server.
- It’s known and used only by the app and the authorization server.
Authentication Steps
Steps 1:
- Create an app in Huggy platform
Huggy
Steps 2:
- Override the parameters
redirect_uri
andclient_id
in the url below.https://auth.huggy.app/oauth/authorize?scope=install_app%20read_agent_profile&response_type=code&redirect_uri={url_de_callback}&client_id={client_id}
1- scope: It's the API scope access (resources);
- response_type: It’s the expected answer. The code sent for the callback url;
- redirect_uri: It’s the callback url configured in the app;
- client_id: It’s the app’s id;
Steps 3:
- Logged in Huggy platform, you have to access the informed uri with the described information on the previous step. If all steps are completed, so the authorization interface will be shown.
Steps 4:
- Grant app usage permission
Steps 5:
- After clicking in “Authorize”, we will send the code to the callback url.
https://nomedoapp.org/auth/callback?code=def50200a66869346ba8d24820a1ed96e267d3518a65d27efe179ab73f1c8e50a0ba7f860b763534eaeec5c895ca7efaf49aa7b5160ab33545c18c59d8672e9d0ae8f98a0b81aaae9b741c8536839dbbb4d2864d08f11d5faeea10bec7a4eba32b3e07c343e6031c280f73d97d1dfd92ec0bfe3a84e6ffb62d18991b21c5825c1ef4c4e2dd0c92550d70aa11184b6f1e7004c09f54826ca47cf42c1065efd0e680e8857909d64e991258e41981858d08bc5e9e70866ec7ab67e500a7af3d84835cbc7a6ca33fc38e782050b62e5af3b280368315bf3dd3c234bffa986426a6eed2efa922e932d9579721e6dc1c3a5e74d949773a3eaaaa596be289d129cb81b62690ba32166b2d54c0725ad510g99f7df41c9edc701e1d60ffed375319dee886287030e6d3f4d0983b4211a4b74d82ff3349f5027eee16bca259e4b5ba88123a4e68e5ce4fad77e3ecd558036271bw566ebe4b5cc0baa1e05bb6c0c5a1d0420ab2bcc3e96396b9b58dc63a345732dcc8246dba3ac5c687eb6981882d37fc84e2e9bc88e8a88f795b6cb7f2dc89d97c0c31b37d207c3b45571e2bc39afb412929485f7a84f485daaae4a7
Nota: The code that was sent to the callback url must be used only once. If you need to generate the access_token again, all the steps, starting with step 2, needs to be repeated.
Steps 6:
- To extract the
access_token
and therefresh_token
, you have to send a request with the following parameters:
Request Parameters
Parameters | Type | Example | Description |
---|---|---|---|
grant_type | string | authorization_code | It’s informs to the token terminal that the app is using the OAuth AUthorization Code |
redirect_uri | string | https://nomedoapp.org/auth/callback | Callback url used to receive the token |
client_id | string | APP-bafb4727-c1fe-47af-8cd7-9f43c1a87767 | Client app’s id |
client_secret | string | 52f9fc0d-daa5-4238-bg36-2rb63db54eeb | It’s known and used only by the app and the authorization server |
code | string | def50200fb4b3a43e7647589... | Code sent to callback url. Ensures client authenticity and token access control |
Request Example
{
"grant_type": "authorization_code",
"redirect_uri": "https://nomedoapp.org/auth/callback",
"client_id": "APP-bafb4727-c1fe-47af-8cd7-9f43c1a87767",
"client_secret": "52f9fc0d-daa5-4238-bg36-2rb63db54eeb",
"code": "def50200fb4b3a43e7b4d2513ae2db4c14a444cbded99f2fbb29e6f0d3d10bfad6c452548252c01ee4060c2ac6c689dab0d8f37664e682d6e275d5c065dad88c219d2bff4d872f2df440736f0919d1420ad05cecd588749a6a375b51790f706fe16e1685100f433d7fbbe464296dd491f0b767e5c934723162fb58aa22f835a2ed37ca60f8dfec57fce7a4bd5d98e3526610796d4b868586f3672636a53b7df771e9c528c51a11a582c5518f72267f94747b7b9bca367add990847dd0d6a07f97f3377c0f80f97736fffde33fb9124524a81c0d27c6877ac6d03b0d00b46f5758c6ba35baadba3766d01cfac5bb0213dc5115cde5645c9a8f0f385893061ff8247c0d222d7f5941795b8332e17b06c0f34c2744056718954eb3d63a60bc5836909c3b314a8ad8ca16d481b126a1971c552153b25aba5087385a3c42c1b60297ba7d86cd81ceab72bb05fe0f5cb767ceb229a7d239c2c2ae8cda7513b6f7230c2ffbc17a82f53297348399ef29527a2a3b138a1da64eae320e0eedb56e11f9c894f057cfd68fc5b0015b8493bd988a810c7b91836e9539df92398bb0c4de66b749747f09f2240a3d24e27"
}
2
3
4
5
6
7
Response Parameters 200
{
"token_type": "Bearer",
"expires_in": 2592000,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImY4ODUxODBhZGU4N2Q0MGE1NmNkNWE4ODE3YzU0YWIyZDliZDg0NmVlODdkYTIzYTg3YThlNjQyZWY4NjczOGQ5Nzg5NDA2ZjU0NmYyYWVhIn0.eyJhdWQiOiJBUFAtZGFmYjQ3MjctYTFmZS00NmFmLTljZDctNmQ0M2MxYTg3NzY3IiwianRpIjoiZjg4NTE4MGFkZTg3ZDQwYTU2Y2Q1YTg3MTdjNTRhYjJkOWJkODQ2ZWU4N2RhMjNhODdhOGU2mDJlZjg2NzM4ZDk3ODk0MDZmNTQ2ZjJhZWEiLCJpYXQiOjE1NzQ4NTk2OTEsIm5iZiI6MTU3NDg1OTY5MSwiZXhwIjoxNTc3NDUxNjkxLCJzdWIiOiIzNDE0NiIsInNjb3BlcyI6WyJpbnN0YWxsX2FwcCIsInJlYWRfYWdlbnRfcHJvZmlsZSJdfQ.WXSsIOigtQh3GEGoGvfogcNiee6y1ElkvXCdOxJSOQr5LXJU-mZR2gCsBLh_XKXtvuj-9MSKHSq10HgsKacLrmJGryaeBvo1m9Ro9GUrTeNPY2cKOtjaCcxTgjRbTUvWQlNOhPMfxNSQ8-2L5-hKwrhxtjbFPghrtF1ifqRj_w0",
"refresh_token": "def5430200ce65d9ae52cbd8e89191c731d15e6836bda7e6ad80a1ffe7f5bbbe971bae5cef6b881054ea003e55cf9d2cefd8218902ad0822bb137a561f7d1d72bada321e607b8acd396b618c933b2aeb4ae0971b7a12e116050f2583b0bf1d6f3bf90635d1fb2f417756b1963c9a55414a9d3cc63374a9683e07b4d07da1299a2c3ccdb6c1s91040ef6279afd7bc1e4b70f070272dcf7cd39c7f2508b2ffdf5f58101f8fc552ae828f372253d67973a2357560944cff5d5c020f1d5da1fdc045d6e5acc8856571635ac0aca0217bc069b9cb4718219f6acd33c77f1b8a4ddcf1742ba122e879054d096a198aab985d2144949444cc078a5d09fa372e91bcb1568c8b0977ad94614223d04f60b6dc245d2e28922ffdcf8284d1a4dde1874b3715bd92019cdb019dec3ef4f6a2d745c6948aebb271e90ed94d1cfce6d6fda526c52175453cabcbc096cf818bd5a32356007c8c40f93fc4694fcbeb51431dc0dbe2e4b05e8a479101fdb457a4a2e29d076701be5a640d6115e43cd261b52f8939ead61d4a11f2f3dab615dbf09e319619833a287f6de6f75f9dc08385af43689fc41b04f92825f2cb0fddb0289e19980"
}
2
3
4
5
6
Nota: The access_token has a five-year expiration date.
Headers
All requests must also include the following headers:
- Content-Type: application/json
- Accept: application/json
- Authorization: Bearer xxxxxxx
Language
By default, when not informed the Accept-Language
, all requests will be answered in english. For get the response at a preferred language, in the header of your request, enter:
- Accept-Language: en
- Accept-Language: pt-br
- Accept-Language: es
Request
By default, all calls in API define that the request is being made directly at the main company. That is: the first company an agent was linked to.
If a request are being made at a secondary company, it must assume the URI model https://api.huggy.app/v3/companies/{companyID}/resource...
Response
Some requests successful can be answered with a status 200 or 204 without a body returning, such as requests that are using POST and DELETE methods.
Pagination
The request parameter is available to all endpoint that list a resource content being accessed.
This list is limited to 20 results and the remaining resource, if exists, can be accessed with a search parameter ?page=1
in one request url. This page start in 0
(first page). If the requested page does not exist, a empty list []
will be returned in the request body.
Usual server responses:
- 200 OK - The request was successful.
- 201 Created - The request was successful and a resource was created.
- 204 Modified - The request was successful and a resource was modified.
- 400 Bad Request - The request could not be understood or was missing required parameters. Check the reason in the body response.
- 401 Unauthorized - Authentication failed or user doesn't have permissions for requested operation. Check the API token, he may be wrong.
- 403 Forbidden - The customer doesn’t have permission to content, the server is reserved to don’t give more answers. Different from code 401, the customer identity is known.
- 404 Not Found - Resource was not found. This could be caused by a non existent ID.
- 423 Locked - The resource being accessed is blocked, not being possible, at the time, to interact with it.
- 501 Request Failed - May be caused by wrong method of request.
Chats
GET/chats
View all chats
This endpoint has some optional parameters to get the data from a chat according to your situation. For this type of request, pass the following attributes followed by the value you want to filter as a parameter in the URL. Example:
Parameters | Type | Option | Description |
---|---|---|---|
agent | int | id | agent id |
department | int | id | department id |
customer | int | id | customer id |
status | string | wait_answer, without_answer, without_interaction, not_read, all_without_filed | Description of values |
situation | string | auto, in_chat, wait_for_chat, blocked, finishing, filed | Description of values |
Description of key status
Values | Description |
---|---|
wait_answer | Last message of contact was not yet read by agent. |
without_answer | A contact has sent a message and is waiting for the agent answer. |
without_interaction | The agent has initialized a chat with the contact and the contact has not interacted yet. |
not_read | Contact send a message and the agent not read it yet. |
all_without_filed | Return all the chats that are not filed. |
Description of key situation
Values | Description |
---|---|
auto | Chats is not automatic |
in_chat | Chats is not in attendance |
wait_for_chat | Chats that is in waiting for attendance in queue |
blocked | Chats blocked by agent |
finishing | Chats that rely on satisfaction survey to end |
filed pass the following attributes | chats are not closed but archived |
Response 200
[
{
"id": 13119881,
"agentId": 34146,
"secondAgentId": null,
"contactId": 5081359,
"siteCustomerId": null,
"messengerId": null,
"departmentId": null,
"tabulationId": null,
"chatTabulation": null,
"lastMessage": {
"text": "Hello Doe",
"sendAt": "2019-06-11 11:44:33"
},
"chatDepartment": null,
"unread": "0",
"channels": [
{
"uuid": "325c3456-9981-43f5-8705-30bcc241fcb2",
"id": "charlesedward@teste.com",
"name": "Charles Edward",
"type": "Email"
}
],
"chatCustomer": {
"id": 5081359,
"name": "Doe",
"mobile": "7588888888",
"phone": null,
"email": "test1@test.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"queueNumber": null,
"situation": "in_chat",
"createdAt": "2019-06-11 11:44:10",
"updatedAt": "2019-06-11 11:44:33",
"attendedAt": "2019-06-11 11:44:14",
"closedAt": null,
"channel": "email"
},
{
"id": 13119877,
"agentId": 34146,
"secondAgentId": null,
"contactId": 5081356,
"siteCustomerId": null,
"messengerId": null,
"departmentId": null,
"tabulationId": null,
"chatTabulation": null,
"lastMessage": {
"text": "Hello, John Doe.",
"sendAt": "2019-06-11 15:13:16"
},
"chatDepartment": null,
"unread": "0",
"channels": [
{
"uuid": "89905a7d-f95b-11e8-8969-0ee2e7d4bad8",
"id": "contato@test.com.br",
"name": "express impression",
"type": "Email"
}
],
"chatCustomer": {
"id": 5081356,
"name": "John",
"mobile": null,
"phone": "551170707070",
"email": "john@doe.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"queueNumber": null,
"situation": "in_chat",
"createdAt": "2019-06-11 10:38:46",
"updatedAt": "2019-06-11 15:13:16",
"attendedAt": "2019-06-11 12:05:38",
"closedAt": null,
"channel": "email"
}
]
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
74
75
76
77
78
79
80
81
82
GET/chats/{id}
View chat details
Get the detailed data of a chat by its ID
.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 17656128 | Chat identifier number |
Response 200
{
"id": 17656128,
"agentId": 39704,
"secondAgentId": null,
"contactId": 7356074,
"siteCustomerId": null,
"messengerId": null,
"departmentId": null,
"tabulationId": null,
"chatTabulation": null,
"lastMessage": {
"text": "Hello, John!",
"sendAt": "2019-05-26 23:07:19"
},
"chatDepartment": null,
"unread": "0",
"channels": [{
"uuid": "89905a7d-f95b-11e8-8969-0ee2e7d4bad8",
"id": "contact@test.com",
"name": "Express Impression",
"type": "Email"
}],
"chatCustomer": {
"id": 7356074,
"name": "John Doe",
"mobile": null,
"phone": "551170707070",
"email": "john@doe.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"queueNumber": null,
"situation": "wait_for_chat",
"createdAt": "2019-05-26 23:07:19",
"updatedAt": null,
"attendedAt": null,
"closedAt": null,
"channel": "email"
}
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
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
GET/chats/{id}/messages
View chats message
Get the detailed data of a chat by its ID
.
This request will return the corresponding chat messages. Therefore, it can return one or more message.
Request
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 17656128 | Chat identifier number |
Response 200
[
{
"id": 270954690,
"text": "https://cdn.pzw.io/1ec9d63c92527f8c794093c78e86561f1a.png",
"isInternal": false,
"isEmail": false,
"sender": {
"id": 33980,
"name": "John Doe",
"mobile": "557576767676",
"phone": "557576767676",
"email": "teste@abc.com",
"photo": "https://cdn.pzw.io/b4cae08a6373897658bb99b076bdb9257fd.jpg"
},
"senderType": "agent",
"receiver": {
"id": 1841996,
"name": "John",
"mobile": "999999999",
"phone": "33333333",
"email": "john@doe.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"receiverType": "widget",
"file": null,
"chat": {
"id": 13122329,
"channel": "widget",
"situation": "in_chat",
"department": false,
"customer": {
"id": 1841996,
"name": "John",
"mobile": "999999999",
"phone": "33333333",
"email": "john@doe.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
}
},
"sendAt": "2019-10-01 10:43:20",
"readAt": null,
"type": "text"
}
]
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
messages.type
type
- Used to represent the type of message returned in a payload.
Value | Description |
---|---|
text | Represents a text message |
image | Represents a link to an image |
audio | Represents an audio message |
video | Represents a link to an video |
document | Represents a document sent by chat" |
Represents an e-mail address | |
sms | Represents a sms |
internalEvent | Represents the occurrence of the internal event. For example, "Agent y defined department x" |
templateMessage | Represents a template message when it is sent in chat |
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
GET/chats/{id}/tags
View all tags of a chat
View the list of tags added to a chat.
Note: Tags are utilized for sintetize the context of an attendance, so we can map it.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 17656128 | Chat identifier number |
Response 200
[
{
"id": "304430",
"name": "restriction"
},
{
"id": "304431",
"name": "blocked"
}
]
2
3
4
5
6
7
8
9
10
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
GET/chats/{id}/agents
View ID of an agent
Get the name
and ID
of an agent by the chat identifier.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 39704 | Chat identifier number |
Response 200
[
{
"name": "Charles",
"id": 39704
}
]
2
3
4
5
6
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
POST/chats/{id}/messages
Add a new message in a chat
Add a new message passing key
and value
in the request body.
A new message can be added in a previously created chat.
Parameters | Type | Example | Description |
---|---|---|---|
id | number | 17656128 | Chat identifier number |
Request example
{
"text": "Hello, John!",
"file": "https://c.pzw.io/img/avatar-user-boy.jpg",
"isInternal": false
}
2
3
4
5
Attribute | Typo | Description | Required |
---|---|---|---|
text | string | Message sent to a contact | Yes |
file | string | URL sent to a contact containing a file | |
isInternal | boolean | Inform if a message is internal |
Allowed file types
- image/jpg
- image/png
- image/gif
- image/bmp
- audio/mp4
- audio/mp3
- audio/wav
- application/pdf
- application/doc
- application/txt
Response 200
{
"id": 270959650,
"text": "Hello, John!",
"isInternal": false,
"isEmail": false,
"sender": {
"id": 33980,
"name": "John Doe",
"mobile": "557599999999",
"phone": "557533333333",
"email": "john@doe.com",
"photo": "https://cdn.pzw.io/b4cae08a6473895bc99b076bdb9257fd.jpg"
},
"senderType": "agent",
"receiver": {
"id": 1842023,
"name": "John Doe",
"mobile": null,
"phone": null,
"email": null,
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
},
"receiverType": "widget",
"file": "https://c.pzw.io/img/avatar-user-boy.jpg",
"chat": {
"id": 13122720,
"channel": "widget",
"situation": "in_chat",
"department": false,
"customer": {
"id": 1842023,
"name": "John Doe",
"mobile": null,
"phone": null,
"email": null,
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
}
},
"sendAt": "2019-10-16 17:44:15",
"readAt": null,
"type": "image"
}
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
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
POST/chats/{id}/transfer
Transfer a chat to another agent
Transfer a chat to another agent. The expected response contains a customerID
and the chatID
that the agent has been transferred.
Note: The agent that will receive the transferred chat will see the message sent on the request on his attendance panel.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 17656128 | Chat identifier number |
Attributes | Type | Description |
---|---|---|
id | int | Agent identifier number |
message | string | Message sent to agent at time of transfer |
Request example
{
"agentId": 39607,
"message": "Hello, follow the service of our customer Emanoel"
}
2
3
4
Response 200
{
"customerId": "7356074",
"id": 17656128
}
2
3
4
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
PUT/chats/{id}/agent
Add an agent
Add an agent to a chat
Note: A guest
agent
can not add other agents. If this is requested, a status400
will be returned.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 17656128 | Chat identifier number |
Attribute | Type | Description |
---|---|---|
id | int | Agent identifier number |
Request example
{
"agentId": 39607
}
2
3
Response 200
Successfully request with the empty body.
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
PUT/chats/{id}/read
Mark messages as read
Mark the chat message as read. An ID
will be required for this.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 17656128 | Chat identifier number |
Response 200
Successfully request with the empty body.
Resposta 403
{
"reason": "This message will inform what caused the error"
}
2
3
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
PUT/chats/{id}/tags
Update chat tags
This action allows you to make changes to the tags
of a chat
, updating, modifying their original value.
To do this, enter in the request parameter the chat ID and in the request body the tag values.
Note: Each value will be passed to the tags key as an
array
containing the name of each of the tags separated by comma. The number of tags that can be reviewed may be greater than existing tags for chat. In this case, one or more tags will be linked to the chat in question. This is possible because a change is made in one array that may have its indexes updated or added, if more tags are passed.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 17656128 | Chat identifier number |
Attribute | Type | Description |
---|---|---|
tags | string | String containing markup tags to chat |
Request example
{
"tags": [
"tag4",
"tag5",
"tag6"
]
}
2
3
4
5
6
7
Response 200
Successfully request with the empty body.
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
PUT/chats/{id}/queue
Move to the queue
Move a chat to the queue. If a request will be successful, a message with status 200 will be returned.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 17656128 | Chat identifier number |
Response 200
Successfully request with the empty body.
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
PUT/chats/{id}/department
Assign a department to a chat
Assigns a department to a chat
. To do this, inform a valid chat id in the request parameter and in the request body the department number that the chat will be assigned.
To do this, informe the valid ID
to a chat and informe in the body request the department number with will be assigned.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 17656128 | Chat identifier number |
Attribute | Type | Description |
---|---|---|
department | int | Department number you want to assign to chat |
Request example
{
"department": 2546
}
2
3
Response 200
Successfully request with the empty body.
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
PUT/chats/{id}/close
Close a chat
Close a chat, passing its ID
in the request parameter.
Note: Optionally, you can close a chat sending a tabulation in the request body.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 17656128 | Chat identifier number |
Example of request
{
"tabulation": "12484",
"comment": "comment through of API"
}
2
3
4
Response 200
Successfully request with the empty body.
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
PUT/chats/{id}/reopen
Reopen a chat
Reopen a chat, passing its ID
in the request parameter.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 17656128 | Chat identifier number |
Response 200
Successfully request with the empty body.
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
DELETE/chats/{id}
Delete a chats
Delete a chat by its ID
.
Note: Only an Administrator has permission to delete a chat. A chat can only be deleted when it has the status finished.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 9838322 | Chat identifier number |
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
Agents
GET/agents
View all agents
Get the information of all registered agents.
Note: This resource has an optional parameter that returns all found records, that is: all records in one or more pages.
Parameter | Type | Example | Description |
---|---|---|---|
allPages | boolean | true | Parameter that will return all records if your value to true |
Response 200
[
{
"id": 39708,
"name": "Kivya",
"email": "test@test.com",
"photo_url": null,
"phone": "5575999999999"
},
{
"id": 39704,
"name": "Charles",
"email": "test@test.com",
"photo_url": null,
"phone": "5575999999999"
}
]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
GET/agents/profile
View the agent profile
Get the agent profile data logged into Huggy platform.
Note: The displayed profile corresponds to the user token that is logged into the platform.
Response 200
{
"id": 39704,
"roleID": "3",
"companyID": "15333",
"name": "Charles",
"email": "test@test.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg",
"createdAt": "2019-05-26 17:48:14"
}
2
3
4
5
6
7
8
9
GET/agents/{id}
View an agent data
Get data from a specific agent. An agent id is required in request parameters.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 39704 | Agent identifier number |
Request 200
{
"id": "39708",
"name": "kivya",
"login": "kivya@test.com",
"status": false,
"companyID": "15333",
"photoLink": null,
"gender": "0",
"birthDate": null,
"email": "knsilvestre@test.com",
"createdAt": "2019-05-26 23:34:53",
"updatedAt": "2019-06-06 10:02:43",
"whatsappID": "5488902",
"maxChats": "8",
"perfilID": "3",
"welcomeText": null,
"departmentsAccess": "1",
"viewedUpdates": "1",
"statusID": null,
"pushToken": null,
"osDevice": null,
"signatureEmail": null,
"autoLogin": null,
"autoDistribution": "0",
"lastAutoChatAt": null,
"active": "1",
"layoutType": "1",
"blocked": 0,
"office": null,
"confirmedEmail": "1",
"confirmEmailAlert": "",
"photo_url": null,
"type": 3,
"roleID": "3",
"phone": "557599999999",
"closedAlertInTrial": true,
"closedAlertExpiredTrial": false,
"perfilName": "Administrator",
"photo_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"image_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"number": "557599999999",
"isActive": true,
"isAvailable": false,
"isOnline": false,
"lastSeen": "2019-06-06 10:14:00",
"isGuest": "Guest"
}
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
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
GET/agents/{id}/status
View agent status
Get the status of an agent by your ID
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 39708 | Agent identifier number |
Response 200
{
"id": null,
"name": "Unavailable",
"message": null,
"type": 0,
"createdAt": null,
"updatedAt": null,
"agentID": 34146,
"available": false
}
2
3
4
5
6
7
8
9
10
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
POST/agents
Invite a new agent
To invite a new agent, three required attributes must be passed in the request body, they are: email, maxChats and type. An agent is defined by its profile access, represented by the type attribute that receives a numeric value, where:
Definition | Attribute | Value |
---|---|---|
Agente | Type | 1 |
Manager | Type | 2 |
Administrator | Type | 3 |
Attribute | Type | Description |
---|---|---|
string | Agent email address | |
maxChats | int | Maximum amount definition to a new agent |
type | int | Perfil identifier number of agent access |
Note: A new agent will be viewed on the Huggy panel only after accepting the invitation sent by email.
Request example
{
"email": "charles@test.com",
"maxChats": 50,
"type": 1
}
2
3
4
5
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
Response 500
{
"reason": "Agent already signed in"
}
2
3
PUT/agents/status
Update the agent status
By default, an agent has two status options, making it available or not.
To update the status of an agent, an ID
attribute must be passed request body with a numeric value that makes the agent available 0
or unavailable -1
.
Attribute | Type | Description |
---|---|---|
id | int | Agent status identifier number |
Request example
"id": 0
Response 200
{
"statusId": null,
"available": true
}
2
3
4
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
PUT/agents/{id}
Update agent
Update an agent information. Some information is required, such as: name and login.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 17656128 | Chat identifier number |
Attributes | Type | Description |
---|---|---|
name | string | Agent name |
login | string | Agent email |
phone | string | Agent phone |
Request example
{
"name": "John Doe",
"login": "john@doe.com",
"phone": 557599999999
}
2
3
4
5
Response 200
Successfully request with the empty body.
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
DELETE/agents/{id}
Delete an agent
Delete an agent in Huggy platform.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 39704 | Chat identifier number |
Response 204
Successfully request with the empty body.
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
Contacts
GET/contacts
View all contacts
Get the data of all registered contacts.
Response 200
[
{
"id": "7662964",
"whatsappID": "5560493",
"name": "Charles",
"companyID": "15333",
"email": "test@test.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg",
"groupID": null,
"address": "Ave Genésio Vargas",
"district": "Mantiqueira",
"state": "Minas Gerais",
"city": "Camanducaia",
"zipCode": "44000000",
"gender": "2",
"obs": null,
"birthDate": null,
"lastSeen": "2019-06-09 10:28:34",
"createdAt": "2019-06-09 10:29:34",
"updatedAt": "2019-06-09 10:29:34",
"status": "1",
"lastSync": null,
"syncWhatsapp": "0",
"lastChatID": null,
"tokens": "charles 7588888888 7533333333 test@test.com 7588888888",
"mobile": "7588888888",
"phone": "7533333333",
"talkChatType": 2,
"organizationID": null,
"blocked": "0",
"canAutoUpdatePhoto": "1",
"telegramID": null,
"tokenTelegram": null,
"telegramBotCustomerID": null,
"parentID": null,
"nameEmoji": "Charles",
"photo_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"image_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"channelsSituation": {
"voip": true,
"messenger": false,
"widget": false,
"telegram": true,
"whatsapp": false,
"email": true,
"sms": true,
"telegramBot": false,
"whatsappApi": false
},
"customFields": [],
"custom_fields": [],
"number": "7588888888",
"type": 2,
"isEditable": true,
"messengerId": null,
"groups": [],
"organizations": [],
"organization": false,
"parent": null,
"links": []
},
{
"id": "7662931",
"whatsappID": "2911451",
"name": "Kivya Aguiar",
"companyID": "15333",
"email": "test@test.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg",
"groupID": null,
"address": "Ave Genésio Vargas",
"district": "Mantiqueira",
"state": "Minas Gerais",
"city": "Camanducaia",
"zipCode": "44000000",
"gender": "1",
"obs": null,
"birthDate": null,
"lastSeen": "2019-06-09 10:24:31",
"createdAt": "2019-06-09 10:25:31",
"updatedAt": "2019-06-09 10:25:31",
"status": "1",
"lastSync": null,
"syncWhatsapp": "0",
"lastChatID": null,
"tokens": "kivya aguiar 75999999999 7533333333 test@test.com 75999999999",
"mobile": "75999999999",
"phone": "7533333333",
"talkChatType": 2,
"organizationID": null,
"blocked": "0",
"canAutoUpdatePhoto": "1",
"telegramID": null,
"tokenTelegram": null,
"telegramBotCustomerID": null,
"parentID": null,
"nameEmoji": "Kivya Aguiar",
"photo_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"image_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"channelsSituation": {
"voip": true,
"messenger": false,
"widget": false,
"telegram": true,
"whatsapp": false,
"email": true,
"sms": true,
"telegramBot": false,
"whatsappApi": false
},
"customFields": [],
"custom_fields": [],
"number": "75999999999",
"type": 2,
"isEditable": true,
"messengerId": null,
"groups": [],
"organizations": [],
"organization": false,
"parent": null,
"links": []
}
]
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
GET/contacts/{id}
View a contact
Get the specific contact data by its ID.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 77663175 | Contact identifier number |
Response 200
{
"id": "4771390",
"whatsappID": null,
"name": "2299951200033583",
"companyID": "11721",
"email": null,
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg",
"groupID": null,
"address": null,
"district": null,
"state": null,
"city": null,
"zipCode": null,
"gender": null,
"obs": null,
"birthDate": null,
"lastSeen": "2019-01-16 15:48:38",
"createdAt": "2019-01-16 15:49:38",
"updatedAt": "2019-01-16 15:49:38",
"status": "1",
"lastSync": null,
"syncWhatsapp": "0",
"lastChatID": null,
"tokens": "2299951200033583",
"mobile": null,
"phone": null,
"talkChatType": 2,
"organizationID": null,
"blocked": "0",
"canAutoUpdatePhoto": "1",
"telegramID": null,
"tokenTelegram": null,
"telegramBotCustomerID": null,
"parentID": null,
"nameEmoji": "2299951200033583",
"photo_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"image_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"channelsSituation": {
"voip": false,
"messenger": false,
"widget": false,
"telegram": false,
"whatsapp": false,
"email": false,
"sms": false,
"telegramBot": false,
"whatsappApi": false
},
"customFields": [],
"custom_fields": [],
"number": null,
"type": 2,
"isEditable": true,
"messengerId": null,
"groups": [],
"organizations": [],
"organization": false,
"parent": null,
"links": []
}
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
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
GET/contacts/{id}/timeline
View a contact timeline
Get the contact timeline data by its ID. The timeline is the data of contact creation and all associated events since then.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 7663175 | Contact identifier number |
Response 200
[
{
"id": 8227983,
"icon": "comment",
"text": "Excelente cliente.",
"title": "Comentário",
"time": "09/07/2019 08:02:27",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg",
"name": "Kivya",
"type": "comment.created",
"channel": null,
"department": null,
"duration": null,
"situation": null,
"chatID": null,
"deleted": false
},
{
"id": 8227983,
"icon": "email",
"text": "A call was initiated by the customer through the email channel",
"title": "Chat started",
"time": "07/07/2019 09:12:28",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg",
"name": "Williams",
"type": "chat.created",
"channel": "email",
"department": null,
"duration": null,
"situation": "in_chat",
"chatID": "19378164",
"deleted": false
},
{
"icon": "user",
"text": "Contact Williams was created",
"title": "Contact created",
"time": "07/07/2019 09:12:15",
"photo": "",
"name": ""
}
]
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
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
GET/contacts/{id}/groups
View a contact group
Get the group data that the contact belong.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 7663175 | Contact identifier number |
Response 200
[
{
"id": "1851",
"name": "TOP 5",
"companyID": "15333",
"createdAt": "2019-06-10 12:14:16",
"updatedAt": "2019-06-10 12:14:16",
"status": "1",
"nameEmoji": "TOP 5"
}
]
2
3
4
5
6
7
8
9
10
11
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
GET/contacts/{id}/organizations
View a contact organization
Get the data of a contact organization.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 7663175 | Contact identifier number |
Response 200
[
{
"id": "18693",
"name": "Huggy",
"cnpj": null,
"ie": null,
"address": null,
"state": null,
"city": null,
"country": null,
"district": null,
"zipCode": null,
"createdAt": "2019-06-11 16:08:36",
"updatedAt": "2019-06-11 16:08:36",
"companyID": "12025",
"status": "1",
"description": "Technology",
"observation": null,
"domains": "huggy.io",
"phone": "7533333333",
"photo": null,
"nameEmoji": "Huggy",
"customFields": []
}
]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
GET/contacts/{id}/customFields
View a custom field
Get the contact custom field data.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 7663175 | Contact identifier number |
Response 200
[
{
"id": "487",
"companyID": "12025",
"name": "alternative email",
"description": "second option of email",
"fieldType": "email",
"payload": null,
"entityID": "1",
"validation": "[\"huggy.validations.email\"]",
"createdAt": "2019-06-11 16:41:31",
"updatedAt": "2019-06-11 16:41:31",
"deletedAt": null,
"active": "1",
"status": "1",
"token": "alternative_email_customer",
"inputType": "input",
"value": "alternative@test.com"
}
]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
GET/contacts/{id}/linkedContacts
View contact associations
An association defines that a contact can be considered main contact of other contact.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 7663175 | Contact identifier number |
Response 200
[
{
"id": "5081373",
"whatsappID": "3951665",
"name": "Karl Edward",
"companyID": "12025",
"email": "karledward@test.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg",
"groupID": null,
"address": "",
"district": "",
"state": null,
"city": "",
"zipCode": "",
"gender": "2",
"obs": null,
"birthDate": null,
"lastSeen": "2019-06-11 17:38:50",
"createdAt": "2019-06-11 17:39:50",
"updatedAt": "2019-06-11 17:39:50",
"status": "1",
"lastSync": null,
"syncWhatsapp": "0",
"lastChatID": null,
"tokens": "karl edward 7588888888 karledward@test.com 7588888888",
"mobile": "7588888888",
"phone": null,
"talkChatType": 2,
"organizationID": null,
"blocked": "0",
"canAutoUpdatePhoto": "1",
"telegramID": null,
"tokenTelegram": null,
"telegramBotCustomerID": null,
"parentID": null,
"nameEmoji": "Karl Edward",
"photo_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"image_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"channelsSituation": {
"voip": true,
"messenger": false,
"widget": false,
"telegram": true,
"whatsapp": false,
"email": true,
"sms": true,
"telegramBot": false,
"whatsappApi": false
},
"customFields": [],
"custom_fields": [],
"number": "7588888888",
"type": 2,
"isEditable": true,
"messengerId": null,
"groups": [],
"organizations": [],
"organization": false,
"parent": null,
"links": [
{
"id": 5081372,
"name": "Charles Edward",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
}
]
}
]
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
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
POST/contacts
Create a contact
To create a new contact, name
and email
information are required
Attributes | Type | Description |
---|---|---|
name | string | Contact name |
string | Contact email |
Requested example
{
"name": "Charles Edware",
"email": "test@test.com"
}
2
3
4
Response 201
{
"id": "7663175",
"whatsappID": null,
"name": "Edward",
"companyID": "15333",
"email": "test@test.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg",
"groupID": null,
"address": null,
"district": null,
"state": null,
"city": null,
"zipCode": null,
"gender": null,
"obs": null,
"birthDate": null,
"lastSeen": "2019-06-09 10:56:01",
"createdAt": "2019-06-09 10:57:01",
"updatedAt": null,
"status": 1,
"lastSync": null,
"syncWhatsapp": null,
"lastChatID": null,
"tokens": null,
"mobile": null,
"phone": null,
"talkChatType": 2,
"organizationID": null,
"blocked": null,
"canAutoUpdatePhoto": null,
"telegramID": null,
"tokenTelegram": null,
"telegramBotCustomerID": null,
"parentID": null,
"nameEmoji": "Edward",
"photo_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"image_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"channelsSituation": {
"voip": false,
"messenger": false,
"widget": false,
"telegram": false,
"whatsapp": false,
"email": true,
"sms": false,
"telegramBot": false,
"whatsappApi": false
},
"customFields": [],
"custom_fields": [],
"number": null,
"type": 2,
"isEditable": true,
"messengerId": null,
"groups": [],
"organizations": [],
"organization": false,
"parent": null,
"links": []
}
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
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
POST/timeline/createComment/{id}
Create a comment in contact timeline
Create a comment in contact’s timeline by its ID. Comments collaborate for report activities with the customer, building a history of their attendance.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 8227983 | Contact identifier number |
Attribute | Type | Description |
---|---|---|
comment | string | Comments inserted by agent in contact panel |
Requested example
{
"comment": "waiting for documents"
}
2
3
Response 201
{
"id": 7740752,
"icon": "comment",
"text": "In last attendance the customer showed interest in acquiring a plan with hight resources",
"title": "Comments",
"time": "12/06/2019 15:55:27",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg",
"name": "Teste",
"type": "comment.created",
"channel": null,
"department": null,
"duration": null,
"situation": null,
"chatID": null,
"deleted": false
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
PUT/contacts/{id}
Update a contact
Update a contact by its ID
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 7663175 | Contact identifier number |
Attributes | Type | Description | Required |
---|---|---|---|
name | string | Contact name | Yes |
string | Contact email | Yes | |
phone | string | Contact phone | Yes |
mobile | string | Contact mobile | No |
address | string | Contact address | No |
city | string | Contact city | No |
district | string | Contact district | No |
state | string | Contact state | No |
obs | string | Comment done about contact | No |
Requested example
{
"name": "john Doe",
"email": "john@doe.com",
"mobile": "7599999999",
"phone": "7533333333",
"address": "Port Prince",
"city": "Feira de Santana",
"district": "Santa Mônica I",
"state": "Bahia",
"obs": "This is a field to comments about the contact"
}
2
3
4
5
6
7
8
9
10
11
Response 200
{
"id": "5080524",
"whatsappID": null,
"name": "john Doe",
"companyID": "11743",
"email": "john@doe.com",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg",
"groupID": null,
"address": "Port Prince",
"district": "Santa Mônica I",
"state": "Bahia",
"city": "Feira de Santana",
"zipCode": null,
"gender": null,
"obs": "This is a field to comments about the contact",
"birthDate": null,
"lastSeen": null,
"createdAt": null,
"updatedAt": null,
"status": 1,
"lastSync": null,
"syncWhatsapp": null,
"lastChatID": null,
"tokens": null,
"mobile": "7599999999",
"phone": "7533333333",
"talkChatType": 2,
"organizationID": null,
"blocked": null,
"canAutoUpdatePhoto": null,
"telegramID": null,
"tokenTelegram": null,
"telegramBotCustomerID": null,
"parentID": null,
"nameEmoji": "john Doe",
"photo_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"image_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"channelsSituation": {
"voip": true,
"messenger": false,
"widget": false,
"telegram": true,
"whatsapp": false,
"email": true,
"sms": true,
"telegramBot": false,
"whatsappApi": false
},
"customFields": [],
"custom_fields": [],
"number": "7599999999",
"type": 2,
"isEditable": true,
"messengerId": null,
"groups": [],
"organizations": [],
"organization": false,
"parent": null,
"links": []
}
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
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
DELETE/contacts/{id}
Delete a contact
Delete a contact by its ID
.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 7663175 | Contact identifier number |
Response 204
Successfully request with the empty body.
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
Custom Fields
GET/customFields
View all custom fields
Get list of all custom fields. Custom fields are useful to insert additional information on the contact.
Response 200
[
{
"id": "906",
"companyID": "12043",
"name": "second email option",
"description": "second email option",
"fieldType": "email",
"payload": null,
"entityID": "1",
"validation": "[\"huggy.validations.email\"]",
"createdAt": "2019-06-12 17:10:21",
"updatedAt": "2019-06-12 17:10:21",
"deletedAt": null,
"active": "1",
"status": "1",
"token": "second_option_email_customer",
"inputType": "input"
},
{
"id": "907",
"companyID": "12043",
"name": "last address of the organization",
"description": "last address",
"fieldType": "string",
"payload": null,
"entityID": "3",
"validation": "[\"huggy.validations.string\"]",
"createdAt": "2019-06-12 17:11:48",
"updatedAt": "2019-06-12 17:11:48",
"deletedAt": null,
"active": "1",
"status": "1",
"token": "last_address_organization",
"inputType": "input"
}
]
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
Channel
GET/channels/{channel}
View a channel
Get the information of a channel. Enter in the url parameter one of the channels below:
- messenger
- telegram
- telegram-bot
- whatsapp-business-api
- widget
Parameter | Type | Example | Description |
---|---|---|---|
channel | string | messenger | Channel identifier name |
Response 200
[
{
"id": "24034",
"name": "Huggy",
"companyID": "11721",
"createdAt": "2019-08-22 16:30:57",
"updatedAt": "2019-10-22 15:28:22",
"uuid": "257027755xxxxxxx",
"likes": "1",
"url": "https://www.facebook.com/Huggy-2570277559710145/",
"subscribed": "1",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg",
"status": "1",
"flowCreateChatID": null,
"flowReopenChatID": null,
"flowCloseChatID": null,
"uuid": "b565d583-1276-4a2c-904b-a03aaxxxxxxx",
"channelType": "Messenger",
"inputFlowID": null,
"outputFlowID": null
},
{
"id": "24147",
"name": "Orient Star",
"companyID": "11721",
"createdAt": "2019-10-18 11:02:05",
"updatedAt": "2019-10-18 11:02:13",
"uuid": "102113221161458",
"likes": "2",
"url": "https://www.facebook.com/Orient-Star-102113221161458/",
"subscribed": "1",
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg",
"status": "1",
"flowCreateChatID": null,
"flowReopenChatID": null,
"flowCloseChatID": null,
"uuid": "69be1ddc-d702-449c-900e-e9cf7xxxxxxx",
"channelType": "Messenger",
"inputFlowID": null,
"outputFlowID": null
}
]
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
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
GET/channels/messenger/{id}
View the data of a fanpage
View the data of a messenger fanpage integrated in Huggy platform.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 24030 | Fanpage identifier number |
Response 200
{
"id": "24030",
"name": "HuggyTeste",
"companyID": "11721",
"createdAt": "2019-08-22 16:30:57",
"updatedAt": "2019-08-22 16:30:57",
"uid": "333323990763912",
"likes": null,
"url": "https://www.facebook.com/HuggyTeste-333323990763912/",
"subscribed": null,
"photo": null,
"status": "1",
"flowCreateChatID": null,
"flowReopenChatID": null,
"flowCloseChatID": null,
"uuid": "9124670c-7895-4d1b-ad8d-40d36xxxxxxx",
"channelType": "Messenger",
"inputFlowID": null,
"outputFlowID": null
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Departments
GET/departments
View all departments
Get the list of all departments created in the company.
Note: This resource has an optional parameter that returns all found records, this is: all records in one or more pages.
Parameter | Type | Example | Description |
---|---|---|---|
allPages | boolean | true | Parameter that will return all records if your value to true |
Response 200
[
{
"id": 25954,
"name": "1 - Financial",
"parentId": null
},
{
"id": 25955,
"name": "2 - Warehouse",
"parentId": null
},
{
"id": 25956,
"name": "3 - Sales",
"parentId": null
}
]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
GET/departments/parents
View all parent departments
Get list of all parent departments. Parent departments are departments that have sub-departments.
Response 200
[
{
"id": 25954,
"name": "1 - Financial"
},
{
"id": 25955,
"name": "2 - Warehouse"
}
]
2
3
4
5
6
7
8
9
10
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
GET/departments/{id}
View a department
Get the registered department information by its ID
.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 25955 | Department identifier number |
Response 200
{
"id": "25955",
"name": "Warehouse",
"companyID": "12043",
"status": "1",
"order": "1",
"color": "#e36c09",
"welcomeText": "You choose the department \"Warehouse\".",
"hourText": null,
"fatherID": null,
"botID": null,
"promoID": null,
"chatFormID": null,
"tags": "Warehouse, Deposit, Storage",
"channelWhatsapp": "1",
"channelTelegram": "1",
"channelMessenger": "1",
"channelWidget": "1",
"channelPhone": "1",
"channelTelegramBot": "1"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Tabulations
GET/tabulations
View all tabulations
Get the list of all created tabulations. Tabulations are useful to identify the context of a chat.
Note: This resource has an optional parameter that returns all found records, this is: all records in one or more pages.
Parameter | Type | Example | Description |
---|---|---|---|
allPages | boolean | true | Parameter that will return all records if your value to true |
Response 200
[
{
"id": 12055,
"name": "Exchange"
},
{
"id": 12054,
"name": "Deadline"
},
{
"id": 12053,
"name": "Doubt"
}
]
2
3
4
5
6
7
8
9
10
11
12
13
14
GET/tabulations/{id}
View a tabulation
Get the data of a tabulation by its ID.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 12054 | Tabulations identifier number |
Response 200
{
"id": "12054",
"companyID": "12043",
"name": "Deadline",
"createdAt": "2019-06-13 09:13:44",
"updatedAt": "2019-06-13 09:13:44",
"status": "1",
"dao": null,
"remapped": []
}
2
3
4
5
6
7
8
9
10
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
Shortcuts
GET/shortcuts
View all shortcuts
Get the list of all shortcuts created in Huggy platform. Shortcuts are used for sending predefined texts, photos, image and others files.
Response 200
[
{
"id": "17229",
"name": "Welcome message",
"key": "wmessage",
"file": null,
"text": "Hello! Welcome to the sales department!"
},
{
"id": "17228",
"name": "Welcome message",
"key": "bvwarehouse",
"file": null,
"text": "Hello! Welcome to the warehouse department!"
},
{
"id": "17227",
"name": "Welcome message",
"key": "bvfinancial",
"file": null,
"text": "Hello! Welcome to the financial department!"
}
]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
GET/shortcuts/{id}
View a shortcut
Get the shortcut data by its ID
.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 17229 | Shortcut identifier number |
Response 200
[
{
"id": "17229",
"name": "Welcome message",
"key": "wsales",
"file": null,
"text": "Hello! Welcome to the sales department!"
}
]
2
3
4
5
6
7
8
9
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
Status
GET/status
View all status
Get the list of all custom status that was created by agents. The agent status corresponds to a special condition that it can be in, but it must be associated with available
or unavailable
option.
Response 200
[
{
"id": "1691",
"name": "Absent",
"message": "Hello! I'll be right back.",
"type": "0",
"createdAt": "2019-06-13 11:59:56",
"updatedAt": "2019-06-13 12:00:16",
"agentID": "34976",
"available": false
},
{
"id": "1690",
"name": "lunch time",
"message": "Hello! Our lunch time is from 13h to 14h.",
"type": "0",
"createdAt": "2019-06-13 11:58:35",
"updatedAt": "2019-06-13 12:00:06",
"agentID": "34976",
"available": false
},
{
"id": "1689",
"name": "Meeting",
"message": "Hello! We are meeting. logo we will follow.",
"type": "0",
"createdAt": "2019-06-13 11:57:21",
"updatedAt": "2019-06-13 11:57:21",
"agentID": "34976",
"available": false
}
]
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
Workflow
GET/workflows
View all workflows
Get the list of all workflows
and their respective phases.
Workflows can be created to guide the attendance phases.
Response 200
[
{
"id": "5656",
"companyID": "12043",
"name": "Delivery cycle",
"createdAt": "2019-06-13 15:05:41",
"updatedAt": "2019-06-13 15:09:10",
"status": "1",
"fatherID": null,
"color": "#4f81bd",
"steps": [
{
"id": "5657",
"companyID": "12043",
"name": "Material preparation",
"createdAt": "2019-06-13 15:06:43",
"updatedAt": "2019-06-13 15:06:43",
"status": "1",
"fatherID": "5656",
"color": null,
"steps": []
},
{
"id": "5658",
"companyID": "12043",
"name": "Material collection",
"createdAt": "2019-06-13 15:06:58",
"updatedAt": "2019-06-13 15:06:58",
"status": "1",
"fatherID": "5656",
"color": null,
"steps": []
},
{
"id": "5659",
"companyID": "12043",
"name": "Send to received",
"createdAt": "2019-06-13 15:07:26",
"updatedAt": "2019-06-13 15:07:26",
"status": "1",
"fatherID": "5656",
"color": null,
"steps": []
},
{
"id": "5660",
"companyID": "12043",
"name": "Feedback delivered",
"createdAt": "2019-06-13 15:08:12",
"updatedAt": "2019-06-13 15:08:12",
"status": "1",
"fatherID": "5656",
"color": null,
"steps": []
}
]
},
{
"id": "5651",
"companyID": "12043",
"name": "Sales validation cycle",
"createdAt": "2019-06-13 14:36:43",
"updatedAt": "2019-06-13 14:36:43",
"status": "1",
"fatherID": null,
"color": "#4f81bd",
"steps": [
{
"id": "5652",
"companyID": "12043",
"name": "Open request",
"createdAt": "2019-06-13 14:37:02",
"updatedAt": "2019-06-13 14:39:53",
"status": "1",
"fatherID": "5651",
"color": null,
"steps": []
},
{
"id": "5653",
"companyID": "12043",
"name": "Validando Informações",
"createdAt": "2019-06-13 14:39:37",
"updatedAt": "2019-06-13 14:40:22",
"status": "1",
"fatherID": "5651",
"color": null,
"steps": []
},
{
"id": "5654",
"companyID": "12043",
"name": "Accepted request",
"createdAt": "2019-06-13 14:40:57",
"updatedAt": "2019-06-13 14:40:57",
"status": "1",
"fatherID": "5651",
"color": null,
"steps": []
},
{
"id": "5655",
"companyID": "12043",
"name": "Request denied",
"createdAt": "2019-06-13 14:41:13",
"updatedAt": "2019-06-13 14:41:13",
"status": "1",
"fatherID": "5651",
"color": null,
"steps": []
}
]
}
]
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
GET/workflows/{id}
View a workflow
Get the workflow data by its ID
.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 5656 | Workflow identifier number |
Response 200
{
"id": "5656",
"companyID": "12043",
"name": "Delivery cycle",
"createdAt": "2019-06-13 15:05:41",
"updatedAt": "2019-06-13 15:09:10",
"status": "1",
"fatherID": null,
"color": "#4f81bd",
"steps": [
{
"id": "5657",
"companyID": "12043",
"name": "Material preparation",
"createdAt": "2019-06-13 15:06:43",
"updatedAt": "2019-06-13 15:06:43",
"status": "1",
"fatherID": "5656",
"color": null,
"steps": []
},
{
"id": "5658",
"companyID": "12043",
"name": "Material collection",
"createdAt": "2019-06-13 15:06:58",
"updatedAt": "2019-06-13 15:06:58",
"status": "1",
"fatherID": "5656",
"color": null,
"steps": []
},
{
"id": "5659",
"companyID": "12043",
"name": "Send to recipient",
"createdAt": "2019-06-13 15:07:26",
"updatedAt": "2019-06-13 15:07:26",
"status": "1",
"fatherID": "5656",
"color": null,
"steps": []
},
{
"id": "5660",
"companyID": "12043",
"name": "Feedback delivered",
"createdAt": "2019-06-13 15:08:12",
"updatedAt": "2019-06-13 15:08:12",
"status": "1",
"fatherID": "5656",
"color": null,
"steps": []
}
]
}
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
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
Bots
GET/bots
View all bots
Get the list of all bots
created in Huggy platform
Response 200
[
{
"id": 2926,
"name": "HuggyBot"
},
{
"id": 2925,
"name": "HuggyGirl"
}
]
2
3
4
5
6
7
8
9
10
GET/bots/{id}
View a bot
Get the bot data by its ID
.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 2926 | Bot identifier number |
Response 200
{
"id": "2926",
"companyID": "15691",
"name": "HuggyBot",
"uid": null,
"createdAt": "2019-06-17 08:40:06",
"updatedAt": "2019-06-17 08:41:58",
"status": "1",
"description": null,
"photo": "https://c.pzw.io/img/avatar-user-boy.jpg",
"phone": null,
"email": "charles@test.com",
"birthday": "2019-06-17",
"transferMessage": "You will transferred for other attendant.",
"welcomeMessage": "Hello, Welcome to the Huggy.",
"maxErrors": "100",
"engineID": "3",
"apiAiLang": "en",
"apiAiClientToken": "d7d1d9daec634e598ea9ccd59acf7693",
"apiAiDeveloperToken": "9555d63499614423859ade081ff74da4",
"watsonUsername": null,
"watsonPassword": null,
"watsonWorkspace": null,
"watsonAcceptEmptyIntents": "0",
"botServiceSecret": null,
"botServiceBotHandle": null
}
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
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
Virtual Agents
GET/virtualAgents
View all virtual agents
Get the list of all virtual agents registered in Huggy platform.
Response 200
[
{
"id": 784,
"name": "huggyboy",
"email": "huggyboy@test.com"
},
{
"id": 785,
"name": "huggygirl",
"email": "huggygirl@test.com"
},
{
"id": 782,
"name": "huggyhank",
"email": "hugggyhenk@test.com"
}
]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
GET/virtualAgents/{id}
View a virtual agent
Get the virtual agent data by its ID
.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 784 | Virtual agent identifier number |
Response 200
{
"id": "784",
"companyID": "15691",
"name": "huggyboy",
"mobile": "557592731111",
"email": "huggyboy@test.com",
"phone": null,
"photoLink": "https://c.pzw.io/img/avatar-user-boy.jpg",
"createdAt": "2019-06-17 17:11:13",
"updatedAt": "2019-06-17 17:11:13",
"status": "1"
}
2
3
4
5
6
7
8
9
10
11
12
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
Projects
GET/projects
View all projects
Get the list of all projects created in Huggy platform. Each project is composed by one or more flows.
Note: In addition to the projects and their respective flows, this action will return the system default context variables.
Response 200
[
{
"id": "487704",
"companyID": "15691",
"name": "Finishes",
"createdBy": "39708",
"status": "1",
"createdAt": "2019-06-16 22:04:19",
"updatedAt": "2019-06-18 06:51:07",
"variables": {
"Flows do projeto": [],
"huggy": {
"time_hello": "huggy.time_hello",
"chat": {
"id": "huggy.chat.id",
"created_at": "huggy.chat.created_at",
"department": {
"id": "huggy.chat.department.id",
"name": "huggy.chat.department.name",
"order": "huggy.chat.department.order"
},
"tabulation": {
"id": "huggy.chat.tabulation.id",
"name": "huggy.chat.tabulation.name"
},
"contact": {
"id": "huggy.chat.contact.id",
"name": "huggy.chat.contact.name",
"created_at": "huggy.chat.contact.created_at",
"first_name": "huggy.chat.contact.first_name",
"second_name": "huggy.chat.contact.second_name",
"mobile": "huggy.chat.contact.mobile",
"email": "huggy.chat.contact.email",
"organization": {
"id": "huggy.chat.contact.organization.id",
"name": "huggy.chat.contact.organization.name",
"description": "huggy.chat.contact.organization.description"
}
},
"company": {
"id": "huggy.chat.company.id",
"name": "huggy.chat.company.name",
"created_at": "huggy.chat.company.created_at",
"phone": "huggy.chat.company.phone"
},
"agent": {
"id": "huggy.chat.agent.id",
"name": "huggy.chat.agent.name",
"email": "huggy.chat.agent.email",
"created_at": "huggy.chat.agent.created_at",
"phone": "huggy.chat.agent.phone"
},
"queue_position": "huggy.chat.queue_position",
"workflow_id": "huggy.chat.workflow_id",
"workflow_step_id": "huggy.chat.workflow_step_id",
"url": "huggy.chat.url",
"channel_type": "huggy.chat.channel_type",
"current_message": "huggy.chat.current_message"
}
}
},
"variables_settings": [],
"hasFlows": true
},
{
"id": "487703",
"companyID": "15691",
"name": "Initializations",
"createdBy": "39708",
"status": "1",
"createdAt": "2019-06-16 20:58:29",
"updatedAt": "2019-06-18 06:51:26",
"variables": {
"Flows do projeto": [],
"huggy": {
"time_hello": "huggy.time_hello",
"chat": {
"id": "huggy.chat.id",
"created_at": "huggy.chat.created_at",
"department": {
"id": "huggy.chat.department.id",
"name": "huggy.chat.department.name",
"order": "huggy.chat.department.order"
},
"tabulation": {
"id": "huggy.chat.tabulation.id",
"name": "huggy.chat.tabulation.name"
},
"contact": {
"id": "huggy.chat.contact.id",
"name": "huggy.chat.contact.name",
"created_at": "huggy.chat.contact.created_at",
"first_name": "huggy.chat.contact.first_name",
"second_name": "huggy.chat.contact.second_name",
"mobile": "huggy.chat.contact.mobile",
"email": "huggy.chat.contact.email",
"organization": {
"id": "huggy.chat.contact.organization.id",
"name": "huggy.chat.contact.organization.name",
"description": "huggy.chat.contact.organization.description"
}
},
"company": {
"id": "huggy.chat.company.id",
"name": "huggy.chat.company.name",
"created_at": "huggy.chat.company.created_at",
"phone": "huggy.chat.company.phone"
},
"agent": {
"id": "huggy.chat.agent.id",
"name": "huggy.chat.agent.name",
"email": "huggy.chat.agent.email",
"created_at": "huggy.chat.agent.created_at",
"phone": "huggy.chat.agent.phone"
},
"queue_position": "huggy.chat.queue_position",
"workflow_id": "huggy.chat.workflow_id",
"workflow_step_id": "huggy.chat.workflow_step_id",
"url": "huggy.chat.url",
"channel_type": "huggy.chat.channel_type",
"current_message": "huggy.chat.current_message"
}
}
},
"variables_settings": [],
"hasFlows": true
}
]
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
GET/projects/{id}
View a project
Get the project data by its ID
.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 487704 | Project identifier number |
Response 200
{
"project": {
"id": "487704",
"companyID": "15691",
"name": "Finishes",
"createdBy": "39708",
"status": "1",
"createdAt": "2019-06-16 22:04:19",
"updatedAt": "2019-06-18 06:51:07",
"variables": {
"Flows do projeto": [],
"huggy": {
"time_hello": "huggy.time_hello",
"chat": {
"id": "huggy.chat.id",
"created_at": "huggy.chat.created_at",
"department": {
"id": "huggy.chat.department.id",
"name": "huggy.chat.department.name",
"order": "huggy.chat.department.order"
},
"tabulation": {
"id": "huggy.chat.tabulation.id",
"name": "huggy.chat.tabulation.name"
},
"contact": {
"id": "huggy.chat.contact.id",
"name": "huggy.chat.contact.name",
"created_at": "huggy.chat.contact.created_at",
"first_name": "huggy.chat.contact.first_name",
"second_name": "huggy.chat.contact.second_name",
"mobile": "huggy.chat.contact.mobile",
"email": "huggy.chat.contact.email",
"organization": {
"id": "huggy.chat.contact.organization.id",
"name": "huggy.chat.contact.organization.name",
"description": "huggy.chat.contact.organization.description"
}
},
"company": {
"id": "huggy.chat.company.id",
"name": "huggy.chat.company.name",
"created_at": "huggy.chat.company.created_at",
"phone": "huggy.chat.company.phone"
},
"agent": {
"id": "huggy.chat.agent.id",
"name": "huggy.chat.agent.name",
"email": "huggy.chat.agent.email",
"created_at": "huggy.chat.agent.created_at",
"phone": "huggy.chat.agent.phone"
},
"queue_position": "huggy.chat.queue_position",
"workflow_id": "huggy.chat.workflow_id",
"workflow_step_id": "huggy.chat.workflow_step_id",
"url": "huggy.chat.url",
"channel_type": "huggy.chat.channel_type",
"current_message": "huggy.chat.current_message"
}
}
},
"variables_settings": [],
"hasFlows": true
}
}
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
POST/projects
Create a project
Create a project passing in the request body the attribute name
and its respective value.
Attribute | Type | Description |
---|---|---|
name | string | Project name that will be created |
Requested example
{
"name": "Electronics"
}
2
3
Response 200
{
"project": {
"id": "487742",
"companyID": "15691",
"name": "Electronics",
"createdBy": "39708",
"status": 1,
"createdAt": "2019-06-18 11:03:38",
"updatedAt": "2019-06-18 11:03:38",
"variables": {
"Flows do projeto": [],
"huggy": {
"time_hello": "huggy.time_hello",
"chat": {
"id": "huggy.chat.id",
"created_at": "huggy.chat.created_at",
"department": {
"id": "huggy.chat.department.id",
"name": "huggy.chat.department.name",
"order": "huggy.chat.department.order"
},
"tabulation": {
"id": "huggy.chat.tabulation.id",
"name": "huggy.chat.tabulation.name"
},
"contact": {
"id": "huggy.chat.contact.id",
"name": "huggy.chat.contact.name",
"created_at": "huggy.chat.contact.created_at",
"first_name": "huggy.chat.contact.first_name",
"second_name": "huggy.chat.contact.second_name",
"mobile": "huggy.chat.contact.mobile",
"email": "huggy.chat.contact.email",
"organization": {
"id": "huggy.chat.contact.organization.id",
"name": "huggy.chat.contact.organization.name",
"description": "huggy.chat.contact.organization.description"
}
},
"company": {
"id": "huggy.chat.company.id",
"name": "huggy.chat.company.name",
"created_at": "huggy.chat.company.created_at",
"phone": "huggy.chat.company.phone"
},
"agent": {
"id": "huggy.chat.agent.id",
"name": "huggy.chat.agent.name",
"email": "huggy.chat.agent.email",
"created_at": "huggy.chat.agent.created_at",
"phone": "huggy.chat.agent.phone"
},
"queue_position": "huggy.chat.queue_position",
"workflow_id": "huggy.chat.workflow_id",
"workflow_step_id": "huggy.chat.workflow_step_id",
"url": "huggy.chat.url",
"channel_type": "huggy.chat.channel_type",
"current_message": "huggy.chat.current_message"
}
}
},
"variables_settings": [],
"hasFlows": false
}
}
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
PUT/projects/{id}
Update the project name
Update the project name passing in the request body the attribute name and its respective value.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 487704 | Project identifier number |
Attribute | Type | Description |
---|---|---|
name | string | New name to project |
Requested example
{
"name": "Electronics"
}
2
3
Response 200
{
"project": {
"id": "487704",
"companyID": "15691",
"name": "Visitor",
"createdBy": "39708",
"status": 1,
"createdAt": "2019-06-16 22:04:19",
"updatedAt": "2019-06-18 11:04:46",
"variables": {
"Flows do projeto": [],
"huggy": {
"time_hello": "huggy.time_hello",
"chat": {
"id": "huggy.chat.id",
"created_at": "huggy.chat.created_at",
"department": {
"id": "huggy.chat.department.id",
"name": "huggy.chat.department.name",
"order": "huggy.chat.department.order"
},
"tabulation": {
"id": "huggy.chat.tabulation.id",
"name": "huggy.chat.tabulation.name"
},
"contact": {
"id": "huggy.chat.contact.id",
"name": "huggy.chat.contact.name",
"created_at": "huggy.chat.contact.created_at",
"first_name": "huggy.chat.contact.first_name",
"second_name": "huggy.chat.contact.second_name",
"mobile": "huggy.chat.contact.mobile",
"email": "huggy.chat.contact.email",
"organization": {
"id": "huggy.chat.contact.organization.id",
"name": "huggy.chat.contact.organization.name",
"description": "huggy.chat.contact.organization.description"
}
},
"company": {
"id": "huggy.chat.company.id",
"name": "huggy.chat.company.name",
"created_at": "huggy.chat.company.created_at",
"phone": "huggy.chat.company.phone"
},
"agent": {
"id": "huggy.chat.agent.id",
"name": "huggy.chat.agent.name",
"email": "huggy.chat.agent.email",
"created_at": "huggy.chat.agent.created_at",
"phone": "huggy.chat.agent.phone"
},
"queue_position": "huggy.chat.queue_position",
"workflow_id": "huggy.chat.workflow_id",
"workflow_step_id": "huggy.chat.workflow_step_id",
"url": "huggy.chat.url",
"channel_type": "huggy.chat.channel_type",
"current_message": "huggy.chat.current_message"
}
}
},
"variables_settings": [],
"hasFlows": true
}
}
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
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
DELETE/projects/{id}
Delete a project
Delete a project by its ID
.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 487704 | Project identifier number |
Response 200
{
"status": true
}
2
3
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
GET/projects/{id}/flows
View all project flows
Get the list of all project flows and its configured actions.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 487704 | Project identifier number |
Response 200
[
{
"id": "30124",
"token": "dfd5a68d-31d4-4261-b659-e5b4c9b26a53",
"description": "Welcome",
"createdAt": "2019-06-16 20:58:43",
"updatedAt": "2019-06-18 06:57:46",
"status": "1",
"companyID": "15691",
"createdBy": null,
"importStatus": "0",
"projectID": "487703",
"importedBy": null,
"actions": [
{
"id": "101122",
"type": "huggy.action.send.message",
"value": "{\"content\":[\"Ol\\u00e1!Welcome to our website.\\n\",\"Would you like to talk to one of our attendants?\\n\",\"Ol\\u00e1!Welcome to our website.\"],\"typing\":false,\"content_type\":\"0\"}",
"order": "0",
"createdAt": "2019-06-16 21:56:03",
"updatedAt": "2019-06-18 06:57:46",
"status": "1",
"companyID": "15691",
"automationFlowID": "30124",
"label": "APP_LABEL_ACTION_SEND_MESSAGE",
"fullValue": {
"content": [
"Hello!Welcome to our website.\n",
"Would you like to talk to one of our attendants?\n",
"Hello!Welcome to our website."
],
"type": {
"type": "0"
},
"typing": false,
"index": 0
}
},
{
"id": "101123",
"type": "huggy.action.send.message",
"value": "{\"content\":[\"Would you like to talk to one of our attendants?\"],\"typing\":false,\"content_type\":\"0\"}",
"order": "1",
"createdAt": "2019-06-16 21:56:03",
"updatedAt": "2019-06-18 06:57:46",
"status": "1",
"companyID": "15691",
"automationFlowID": "30124",
"label": "APP_LABEL_ACTION_SEND_MESSAGE",
"fullValue": {
"content": [
"Would you like to talk to one of our attendants?"
],
"type": {
"type": "0"
},
"typing": false,
"index": 0
}
},
{
"id": "101766",
"type": "huggy.action.conditional",
"value": "{\"action\":{\"type\":\"huggy.action.transfer.to.agent\",\"label\":\"APP_LABEL_ACTION_TRANSFER_TO_AGENT\",\"id\":\"\",\"companyID\":15691,\"value\":39704,\"fullValue\":[],\"order\":0},\"conditions\":[{\"type\":\"huggy.conditional.variable\",\"operator\":\"=\",\"value\":{\"key\":\"pTransfAgent\",\"value\":\"SIM\",\"customVariable\":true}}]}",
"order": "2",
"createdAt": "2019-06-18 06:57:46",
"updatedAt": "2019-06-18 06:57:46",
"status": "1",
"companyID": "15691",
"automationFlowID": "30124",
"label": "APP_LABEL_ACTION_CONDITIONAL",
"fullValue": {
"id": "39704",
"name": "Aguiar",
"login": "carlos@teste.com",
"status": "1",
"companyID": "15333",
"photoLink": null,
"gender": "0",
"birthDate": null,
"email": "Charles@test.com",
"createdAt": "2019-05-26 17:48:14",
"updatedAt": "2019-06-09 08:08:47",
"whatsappID": "5488902",
"maxChats": "1000",
"perfilID": "3",
"welcomeText": null,
"departmentsAccess": "1",
"viewedUpdates": "1",
"statusID": null,
"pushToken": null,
"osDevice": null,
"signatureEmail": null,
"autoLogin": null,
"autoDistribution": "0",
"lastAutoChatAt": null,
"active": "1",
"layoutType": "1",
"blocked": 0,
"office": "Outro",
"confirmedEmail": "1",
"confirmEmailAlert": "",
"perfilName": "Administrator",
"photo_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"image_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"number": "5575999999999",
"type": 1,
"isActive": true,
"isAvailable": false,
"isOnline": false,
"lastSeen": "2019-05-26 17:47:14",
"isGuest": ""
}
}
],
"variables": []
},
{
"id": "30320",
"token": "92e5f207-daee-4571-af39-34f935024128",
"description": "Electronics",
"createdAt": "2019-06-18 11:46:59",
"updatedAt": "2019-06-18 11:46:59",
"status": "1",
"companyID": "15691",
"createdBy": null,
"importStatus": "0",
"projectID": "487703",
"importedBy": null,
"actions": [],
"variables": []
},
{
"id": "30321",
"token": "897734d9-d832-45c9-885f-26270ed67bda",
"description": "Clothing",
"createdAt": "2019-06-18 11:47:19",
"updatedAt": "2019-06-18 11:47:19",
"status": "1",
"companyID": "15691",
"createdBy": null,
"importStatus": "0",
"projectID": "487703",
"importedBy": null,
"actions": [],
"variables": []
},
{
"id": "30322",
"token": "0e44ccba-299e-4c6d-80be-7be3b55a83df",
"description": "Kids",
"createdAt": "2019-06-18 11:47:51",
"updatedAt": "2019-06-18 11:47:51",
"status": "1",
"companyID": "15691",
"createdBy": null,
"importStatus": "0",
"projectID": "487703",
"importedBy": null,
"actions": [],
"variables": []
}
]
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
GET/projects/{projectId}/flows/{flowId}
View a flow
Get the flow data by its ID
.
Note: Optionally you can do this request with the `.../projects/flows/{flowId}' uri.
Parameters | Type | Example | Description |
---|---|---|---|
projectId | number | 487704 | Project identifier number |
flowId | number | 30124 | Flow identifier number |
Response 200
{
"id": "30124",
"token": "dfd5a68d-31d4-4261-b659-e5b4c9b26a53",
"description": "Welcome",
"createdAt": "2019-06-16 20:58:43",
"updatedAt": "2019-06-18 06:57:46",
"status": "1",
"companyID": "15691",
"createdBy": null,
"importStatus": "0",
"projectID": "487703",
"importedBy": null,
"actions": [
{
"id": "101122",
"type": "huggy.action.send.message",
"value": "{\"content\":[\"Ol\\u00e1! Welcome to our website.\\n\",\"Would you like to talk to one of our attendants?\\n\",\"Ol\\u00e1!Welcome to our website.\"],\"typing\":false,\"content_type\":\"0\"}",
"order": "0",
"createdAt": "2019-06-16 21:56:03",
"updatedAt": "2019-06-18 06:57:46",
"status": "1",
"companyID": "15691",
"automationFlowID": "30124",
"label": "APP_LABEL_ACTION_SEND_MESSAGE",
"fullValue": {
"content": [
"Hello! Welcome to our website.\n",
"Would you like to talk to one of our attendants?\n", "Hello! Welcome to our website."
],
"type": {
"type": "0"
},
"typing": false,
"index": 1
}
},
{
"id": "101123",
"type": "huggy.action.send.message",
"value": "{\"content\":[\"Would you like to talk to one of our attendants?\"],\"typing\":false,\"content_type\":\"0\"}",
"order": "1",
"createdAt": "2019-06-16 21:56:03",
"updatedAt": "2019-06-18 06:57:46",
"status": "1",
"companyID": "15691",
"automationFlowID": "30124",
"label": "APP_LABEL_ACTION_SEND_MESSAGE",
"fullValue": {
"content": [
"Would you like to talk to one of our attendants?"
],
"type": {
"type": "0"
},
"typing": false,
"index": 0
}
},
{
"id": "101766",
"type": "huggy.action.conditional",
"value": "{\"action\":{\"type\":\"huggy.action.transfer.to.agent\",\"label\":\"APP_LABEL_ACTION_TRANSFER_TO_AGENT\",\"id\":\"\",\"companyID\":15691,\"value\":39704,\"fullValue\":[],\"order\":0},\"conditions\":[{\"type\":\"huggy.conditional.variable\",\"operator\":\"=\",\"value\":{\"key\":\"pTransfAgent\",\"value\":\"SIM\",\"customVariable\":true}}]}",
"order": "2",
"createdAt": "2019-06-18 06:57:46",
"updatedAt": "2019-06-18 06:57:46",
"status": "1",
"companyID": "15691",
"automationFlowID": "30124",
"label": "APP_LABEL_ACTION_CONDITIONAL",
"fullValue": {
"id": "39704",
"name": "Aguiar",
"login": "carlos@teste.com",
"status": "1",
"companyID": "15333",
"photoLink": null,
"gender": "0",
"birthDate": null,
"email": "Charles@test.com",
"createdAt": "2019-05-26 17:48:14",
"updatedAt": "2019-06-09 08:08:47",
"whatsappID": "5488902",
"maxChats": "1000",
"perfilID": "3",
"welcomeText": null,
"departmentsAccess": "1",
"viewedUpdates": "1",
"statusID": null,
"pushToken": null,
"osDevice": null,
"signatureEmail": null,
"autoLogin": null,
"autoDistribution": "0",
"lastAutoChatAt": null,
"active": "1",
"layoutType": "1",
"blocked": 0,
"office": "Outro",
"confirmedEmail": "1",
"confirmEmailAlert": "",
"perfilName": "Administrator",
"photo_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"image_small": "https://c.pzw.io/img/avatar-user-boy.jpg",
"number": "5575999999999",
"type": 1,
"isActive": true,
"isAvailable": false,
"isOnline": false,
"lastSeen": "2019-05-26 17:47:14",
"isGuest": ""
}
}
],
"variables": []
}
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
POST/projects/{id}/flows
Create a flow
Pass in the query parameter the project ID and in the request body the attribute description
so that the flow will be created.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 487704 | Project identifier number |
Attribute | Type | Description |
---|---|---|
description | string | Flow description to be created |
Requested example
{
"description": "tracking"
}
2
3
Response 200
{
"id": "30358",
"token": "63cb5ca6-9069-4144-a241-4df582af3b6e",
"description": "Tracking",
"createdAt": null,
"updatedAt": null,
"status": null,
"companyID": 15691,
"createdBy": null,
"importStatus": null,
"projectID": 487759,
"importedBy": null,
"actions": [],
"variables": []
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
PUT/projects/{projectId}/flows/{flowId}
Update a flow
Update the flow description.
Parameters | Type | Example | Description |
---|---|---|---|
projectId | number | 487704 | Project identifier number |
flowId | number | 30320 | Project flow number |
Attribute | Type | Description |
---|---|---|
description | string | The new description flow |
Requested example
{
"description": "New description"
}
2
3
Response 200
{
"id": "30320",
"token": "92e5f207-daee-4571-af39-34f935024128",
"description": "new description",
"createdAt": "2019-06-18 11:46:59",
"updatedAt": "2019-06-25 08:59:19",
"status": "1",
"companyID": "15691",
"createdBy": null,
"importStatus": "0",
"projectID": "487703",
"importedBy": null,
"actions": [],
"variables": []
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
DELETE/projects/{projectsId}/flows/{flowId}
Delete a flow
Delete a flow by its ID.
Note: It doesn’t possible to delete a flow in use.
Parameters | Type | Example | Description |
---|---|---|---|
projectId | number | 487704 | Project identifier number |
flowId | number | 30772 | Flow identifier number |
Response 204
{
"status": true
}
2
3
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
Organizations
GET/organizations
View all organizations
View a list of all organizations registered in Huggy platform.
Response 200
[
{
"id": "19706",
"name": "hankmark",
"cnpj": null,
"ie": null,
"address": null,
"state": null,
"city": null,
"country": null,
"district": null,
"zipCode": null,
"createdAt": "2019-06-26 11:27:12",
"updatedAt": "2019-06-26 11:27:12",
"companyID": "15691",
"status": "1",
"description": "shoe distributor",
"observation": null,
"domains": "henkmark.com",
"phone": "5575999999999",
"photo": null,
"nameEmoji": "hankmark",
"customFields": []
},
{
"id": "19704",
"name": "Huggy",
"cnpj": null,
"ie": null,
"address": null,
"state": null,
"city": null,
"country": null,
"district": null,
"zipCode": null,
"createdAt": "2019-06-26 11:22:54",
"updatedAt": "2019-06-26 11:22:54",
"companyID": "15691",
"status": "1",
"description": "Digital attendance",
"observation": null,
"domains": "huggy.io",
"phone": "75999999999",
"photo": null,
"nameEmoji": "Huggy",
"customFields": []
},
{
"id": "19705",
"name": "Huggy",
"cnpj": null,
"ie": null,
"address": null,
"state": null,
"city": null,
"country": null,
"district": null,
"zipCode": null,
"createdAt": "2019-06-26 11:25:57",
"updatedAt": "2019-06-26 11:25:57",
"companyID": "15691",
"status": "1",
"description": "Digital Attendance",
"observation": null,
"domains": "testhuggy.com",
"phone": "75999999999",
"photo": null,
"nameEmoji": "Huggy",
"customFields": []
}
]
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
POST/organizations
Create a new organization
Create a new organization in Huggy platform. Pass in the request body the attribute name with its respective value.
Attribute | Type | Description |
---|---|---|
name | string | Organization name |
Requested example
{
"name": "Huggy"
}
2
3
Response 200
{
"id": "18711",
"name": "Huggy",
"cnpj": null,
"ie": null,
"address": null,
"state": null,
"city": null,
"country": null,
"district": null,
"zipCode": null,
"createdAt": null,
"updatedAt": null,
"companyID": "11721",
"status": 1,
"description": null,
"observation": null,
"domains": null,
"phone": null,
"photo": null,
"nameEmoji": "Huggy",
"customFields": []
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Response 400
{
"reason": "This message will inform what caused the error"
}
2
3
PUT/organizations/{Id}
Update a organization
Update the organization name.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 19709 | Organization identifier number |
Attribute | Type | Description |
---|---|---|
name | string | Organization name |
Requested example
{
"name": "Huggy"
}
2
3
Response 200
{
"id": "18697",
"name": "Huggy",
"cnpj": null,
"ie": null,
"address": null,
"state": null,
"city": null,
"country": null,
"district": null,
"zipCode": null,
"createdAt": null,
"updatedAt": null,
"companyID": "11721",
"status": 1,
"description": null,
"observation": null,
"domains": null,
"phone": null,
"photo": null,
"nameEmoji": "Huggy",
"customFields": []
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
DELETE/organizations/{Id}
Delete a organization
Delete a organization by its ID
.
Parameter | Type | Example | Description |
---|---|---|---|
id | number | 19709 | Organization identifier number |
Response 204
Successfully request with the empty body.
Response 404
{
"reason": "This message will show that doesn't exist result for your search"
}
2
3
4
Companies
GET/companies
View all companies
Get the list of all agent companies.
Note: The access token in the API belong to the agent. Therefore, the listed companies at this endpoint match the companies of the token owner.
Response 200
[
{
"id": 15691,
"name": "Huggy"
},
{
"id": 15693,
"name": "Hank"
}
]
2
3
4
5
6
7
8
9
10