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

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

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.

Authentication Steps

Steps 1:

  • Create an app in Huggy platform Huggy

Steps 2:

  • Override the parameters redirect_uri and client_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.

OAuth 2.0 Authentication

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
1

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 the refresh_token, you have to send a request with the following parameters:
POST https://auth.huggy.app/oauth/access_token

Request parameters

ParameterTypeExampleDescription
grant_typestringauthorization_codeIt’s informs to the token terminal that the app is using the OAuth Authorization Code
redirect_uristringhttps://appname.org/auth/callbackCallback url used to receive the token
client_idstringAPP-bafb4727-c1fe-47af-8cd7-9f43c1a87767Client app’s id
client_secretstring52f9fc0d-daa5-4238-bg36-2rb63db54eebIt’s known and used only by the app and the authorization server
codestringdef50200fb4b3a43e7647589...Code sent to callback url. Ensures client authenticity and token access control
grant_type
string

Exemplo: authorization_code

It’s informs to the token terminal that the app is using the OAuth Authorization Code


redirect_uri
string

Exemplo: https://appname.org/auth/callback

Callback url used to receive the token


client_id
string

Exemplo: APP-bafb4727-c1fe-47af-8cd7-9f43c1a87767

Client app’s id


client_secret
string

Exemplo: 52f9fc0d-daa5-4238-bg36-2rb63db54eeb

It’s known and used only by the app and the authorization server


code
string

Exemplo: def50200fb4b3a43e7647589...

Code sent to callback url. Ensures client authenticity and token access control


Request Example

{
	 "grant_type": "authorization_code",
	 "redirect_uri": "https://appname.org/auth/callback",
	 "client_id": "APP-bafb4727-c1fe-47af-8cd7-9f43c1a87767",
	 "client_secret": "52f9fc0d-daa5-4238-bg36-2rb63db54eeb",
     "code": "def50200fb4b3a43e7b4d2513ae2db4c14a444cbded99f2fbb29e6f0d3d10bfad6c452548252c01ee4060c2ac6c689dab0d8f37664e682d6e275d5c065dad88c219d2bff4d872f2df440736f0919d1420ad05cecd588749a6a375b51790f706fe16e1685100f433d7fbbe464296dd491f0b767e5c934723162fb58aa22f835a2ed37ca60f8dfec57fce7a4bd5d98e3526610796d4b868586f3672636a53b7df771e9c528c51a11a582c5518f72267f94747b7b9bca367add990847dd0d6a07f97f3377c0f80f97736fffde33fb9124524a81c0d27c6877ac6d03b0d00b46f5758c6ba35baadba3766d01cfac5bb0213dc5115cde5645c9a8f0f385893061ff8247c0d222d7f5941795b8332e17b06c0f34c2744056718954eb3d63a60bc5836909c3b314a8ad8ca16d481b126a1971c552153b25aba5087385a3c42c1b60297ba7d86cd81ceab72bb05fe0f5cb767ceb229a7d239c2c2ae8cda7513b6f7230c2ffbc17a82f53297348399ef29527a2a3b138a1da64eae320e0eedb56e11f9c894f057cfd68fc5b0015b8493bd988a810c7b91836e9539df92398bb0c4de66b749747f09f2240a3d24e27"
}
1
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"
}
1
2
3
4
5
6

Nota: The access_token has a five-year expiration date.


Update token.

If your token has expired, the update can be done by the access_token and the refresh_token, as demonstrated:

POST https://auth.huggy.app/oauth/access_token
ParameterTypeDescription
access_tokenstringExpired token
access_token
string

Expired token


Body parameters

ParameterTypeExemploDescription
grant_typestringrefresh_tokenThis will inform the token terminal that the application is using the granttype to update an expired Token
client_idstringAPP-bafb4727-c1fe-47af-8cd7-9f43c1a87767Client apllication ID
client_secretstring52f9fc0d-daa5-4238-bg36-2rb63db54eebKnown and used only by the application and the authorization server
refresh_tokenstringdef50200fb4b3a43e7647589...Update code for an expired token
grant_type
string

Exemplo: refresh_token

This will inform the token terminal that the application is using the grant_type to update an expired Token


client_id
string

Exemplo: APP-bafb4727-c1fe-47af-8cd7-9f43c1a87767

Client apllication ID


client_secret
string

Exemplo: 52f9fc0d-daa5-4238-bg36-2rb63db54eeb

Known and used only by the application and the authorization server


refresh_token
string

Exemplo: def50200fb4b3a43e7647589...

Update code for an expired token


Request example

{
    "grant_type": "refresh_token",
    "client_id": "APP-2d6ea240-4c53-46e2-85c9-e3ced06e1c5d",
    "client_secret": "6c9daa24-ebf3-4f7f-90as-8ca086fae8e8",
    "refresh_token": "def50200408af6f3ed19ae9ab90ae2190ae199980dc1487eba8c30043bd7f7275b4beef4eca314ceca7368b7f52519139e9ad6cb5bd69383401fa8c6497559c0797ea4dd46dc0fb794fdefff479d8cce768208dfbdd93692939d6c44a8e6704b816babcd20796759c8bda4047cad7d1de5ba8a2e70742ff86e87963bd58caebc683f8c2d845a20be5b03273ff28819538af334995e5744163b9778404090b228cee51bf27c916eaecfd9c9aedf2bc7bfd8b9f8322b978cc5c18f6437bae1b4439db249609326960db6ef0dc7f4c57098d77d7f46ad95f274442e01a4eca126651efeca03af33c6e6c9c16dbd635867fb66564bede35fb7a4e750234bbbd4b13c450c19cc2d844cc6cee4c20177f4ad6bd159cc1eb2cc6dec0065bd8f324cbb19193e9344d4c1e75833ae2a8b0ba8c64cf46e1bc502a800b120dec82f9522f3667dcd1b9b0dfba5bed2c5e8e4fa6697e959d09b95f93b8347ee1e11b9b2d083a34e3a9d4bb3fda40e6f2e14edb3fc9f32215242f6d91e6197855fec8037237371e0b6ba5168563570e15223c52fbe887263676e98e9045e34b677a9b2fab191f23c6ecc28c210f5f4fcc741d1ceb"
}
1
2
3
4
5
6

Response parameters 200

{
    "token_type": "Bearer",
    "expires_in": 2505600,
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGdiOiJSUPI1NiIsImp0aSI6ImNmZGQwMThmOTMzYTA2ZDIyNDY2NzUzMzk2ODk2MjRkYjAwNTRhMDg4MzlkODk3ZDQ5MjJlMDk3MTP4MTY0MThkNzQ3Y2YxYTQyNmQzNmNmIn0.eyJhdWQiOiJBUFAtNGQ2ZWEyNTAiQGM1My00NmUxLTg1YzstZTNjZWQwNmUyYzVkIiwianRpIjoiY2ZkZDAxOGY5MzNhMDZkMjI0NjY3NTMzOTY4OTYyNGRiMAA1NGEwODgzOWQ4OTdkNDkyMmUwOTcxMDgxNjQxOGQ3NDdjZjFhNDI2ZDM2Y2YiLCJpYXQiOjE1ODEzNDU0NjYsIm5iZiQ6MTU4MTM0NTQ2NiwiZXhwIjoxNTgzODUxMDY2LCJzdWIiOiIzNDE0NiIsInNjb3BlcyI6WyJpbnN0YWxsX2FwcCIsInJEYWRfYWdlbnRfcHJvZmlsSSJdfQ.VL5fgtj4ioZOvvh9QDBD9Uk-DwtezOKfCNTOC0wFDxYIH_3s_l6sZmyAAPAm4yB-XSZMNXeItqeC-JSICt1pSPbf74Dn9i5Nyn_Evi2Owt4V9I_efuLNSCC6XM8u59l5LUfkt5ICTBRDBnkK2ux6zuYsUzCYjMS8U3qW_Z6g0SE",
    "refresh_token": "def5020048b980d8104a5f09caaa3ba7eec0acfd84cb026a48623b1b61146d4a175d92c4fbea51d3d2143a2ed2c7b7b7be85c8a4b2a6de1154ecbfe44a3814fce8e7c59c578f38112eebb1c218c0c6e088bef56950ef0d940cc45abad9128deeb1fb2f4fd2ba0b4sd018509da99f43ff4d355ab542503382cd827b6948922ffb1216b349e93eb2d2ecce9bb567bf4960e336776af882824f1d4791ad38da2b1a92c32ca50afceee3b9283a474cb1ed932359f4c77d7908fbd13e275b66f913784f2a155ae0593d119dcfda0dcc44d7fa2240ac15817cb95c1303d8d36f1a39602f1162d87e749b0f8a188c9b21314737a7cada2d51299e5d27f9ee95f250b35e20de728711cebd6bde748246629ea40f8402a7586ba54db349f61a42e7cea417617ff0d7fda0deb1c6f9afcd2bae45d526518cd7f52e62a22ba0530e3afd50b0d8896653d2c0bf0b2d525e200613f5b45bd432s6e4cdcefa5730b7d570641fe3e46f3f0705361737684000fc337880cae515983b0d718046c99c7348be65c9a478cf1d7a0de0f05f9f9baac79e0f5b9a7aa7f66a0272705dead82d475ac2ea687453f26d46bb771b9cb19ca36ecc"
}
1
2
3
4
5
6

Note: The updated Token has a validity period of 29 days.

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:

ParameterTypeDescription
agentintegerAgent ID
departmentintegerDepartment ID
customerintegerCustomer ID
situationstringView Values
statusstringView values
agent
integer

Agent ID


department
integer

Department ID


customer
integer

Customer ID


situation
string

View Values


status
string

View values


Filter of chats by channels

The Chats can be filtered by channels with the channel parameter.

The Channels can be:

  • whatsapp
  • telegram
  • messenger
  • email

Response 200

[
    {
        "id": 1488,
        "agentId": null,
        "secondAgentId": null,
        "contactId": 24,
        "departmentId": null,
        "tabulationId": 17044,
        "chatTabulation": {
            "id": "17044",
            "name": "Opa"
        },
        "lastMessage": {
            "text": "Sessão ativa.",
            "file": null,
            "sendAt": "2020-05-30 13:03:00",
            "senderType": "1",
            "sender": {
                "id": "1",
                "name": "Auto",
                "mobile": null,
                "phone": null,
                "email": null,
                "photo": "https://cdn.pzw.io/416934ac2aa73059a78594e63c0a03ae.jpg"
            }
        },
        "chatDepartment": null,
        "unread": 3,
        "channels": [
            {
                "uuid": "a5dd1655-5cb8-4905-99c6-d77f8ec3570c",
                "id": "a5dd1655-5cb8-4905-99c6-d77f8ec3570c",
                "name": "MB Sandbox",
                "type": "Whatsapp-Enterprise"
            }
        ],
        "chatCustomer": {
            "id": 24,
            "name": "Nicolas Tesla",
            "mobile": "557599999999",
            "phone": null,
            "email": "",
            "photo": "https://cdn.pzw.io/af33e7b1321c8eeae152f57635142bba.jpg",
            "custom_fields": {
                "apelido_customer": "teste",
                "empresa_customer": null
            }
        },
        "queueNumber": null,
        "situation": "auto",
        "createdAt": "2020-05-30 13:02:58",
        "updatedAt": "2020-05-30 13:03:02",
        "attendedAt": null,
        "closedAt": null,
        "state": "without_answer",
        "channel": "whatsapp-enterprise",
        "agents": []
    },
    {
        "id": 1487,
        "agentId": 21564,
        "secondAgentId": null,
        "contactId": 24,
        "departmentId": null,
        "tabulationId": 17044,
        "chatTabulation": {
            "id": "17044",
            "name": "Opa"
        },
        "lastMessage": {
            "text": "Você possui um atendimento finalizado recentemente. Deseja reabri-lo? Digite o número da opção desejada\n\n1 - Reabrir atendimento\n2 - Novo atendimento",
            "file": null,
            "sendAt": "2020-05-30 13:02:33",
            "senderType": "1",
            "sender": {
                "id": "1",
                "name": "Auto",
                "mobile": null,
                "phone": null,
                "email": null,
                "photo": "https://cdn.pzw.io/416934ac2aa73059a78594e64c0a03ae.jpg"
            }
        },
        "chatDepartment": null,
        "unread": 0,
        "channels": [
            {
                "uuid": "a5dd1655-5cc8-4905-99c6-d77f8ec3570c",
                "id": "a5dd1655-5cb8-4805-99c6-d77f8ec3570c",
                "name": "MB Sandbox",
                "type": "Whatsapp-Enterprise"
            }
        ],
        "chatCustomer": {
            "id": 24,
            "name": "John Doe",
            "mobile": "557583158424",
            "phone": null,
            "email": "john@teste.com",
            "photo": "https://cdn.pzw.io/af33e7b1521c8eeae152f57635142bba.jpg",
            "custom_fields": {
                "apelido_customer": "Ç",
                "empresa_customer": null
            }
        },
        "queueNumber": null,
        "situation": "finishing",
        "createdAt": "2020-05-30 13:01:58",
        "updatedAt": "2020-05-30 13:02:33",
        "attendedAt": "2020-05-30 13:02:19",
        "closedAt": "2020-05-30 13:02:22",
        "state": "without_answer",
        "channel": "whatsapp-enterprise",
        "agents": [
            {
                "id": 21564,
                "name": "John Doe",
                "mobile": "557599999999",
                "phone": "557599999999",
                "email": "john@doe.com",
                "photo": "https://cdn.pzw.io/474393db01f9171f6bf15042e8f587.jpg",
                "isActive": true,
                "isOnline": true,
                "isAvailable": false,
                "photo_url": "https://cdn.pzw.io/4743932db30f9171f6bf15042e8f87.jpg"
            }
        ]
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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

GET/chats/{id}

View chat details

Get the detailed data of a chat by its ID.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


Response 200

    {
        "id": 1488,
        "agentId": null,
        "secondAgentId": null,
        "contactId": 24,
        "departmentId": null,
        "tabulationId": 17044,
        "chatTabulation": {
            "id": "17044",
            "name": "Opa"
        },
        "lastMessage": {
            "text": "Sessão ativa.",
            "file": null,
            "sendAt": "2020-05-30 13:03:00",
            "senderType": "1",
            "sender": {
                "id": "1",
                "name": "Auto",
                "mobile": null,
                "phone": null,
                "email": null,
                "photo": "https://cdn.pzw.io/416934ac2aa73059a78594e63c0a03ae.jpg"
            }
        },
        "chatDepartment": null,
        "unread": 3,
        "channels": [
            {
                "uuid": "a5dd1655-5cb8-4905-99c6-d77f8ec3570c",
                "id": "a5dd1655-5cb8-4905-99c6-d77f8ec3570c",
                "name": "MB Sandbox",
                "type": "Whatsapp-Enterprise"
            }
        ],
        "chatCustomer": {
            "id": 24,
            "name": "Nicolas Tesla",
            "mobile": "557599999999",
            "phone": null,
            "email": "",
            "photo": "https://cdn.pzw.io/af33e7b1321c8eeae152f57635142bba.jpg",
            "custom_fields": {
                "apelido_customer": "teste",
                "empresa_customer": null
            }
        },
        "queueNumber": null,
        "situation": "auto",
        "createdAt": "2020-05-30 13:02:58",
        "updatedAt": "2020-05-30 13:03:02",
        "attendedAt": null,
        "closedAt": null,
        "state": "without_answer",
        "channel": "whatsapp-enterprise",
        "agents": []
    },
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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

Response 400

{
   "reason": "This message will inform what caused the error"
}
1
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.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


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"
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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.
ValueDescription
textRepresents a text message
imageRepresents a link to an image
audioRepresents an audio message
videoRepresents a link to an video
documentRepresents a document sent by chat
emailRepresents an e-mail address
smsRepresents a sms
internalEventRepresents the occurrence of the internal event. For example, Agent Y defined department X
templateMessageRepresents a template message when it is sent in chat
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


email

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"
}
1
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.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


Response 200

[
    {
        "id": "304430",
        "name": "restriction"
    },
    {
        "id": "304431",
        "name": "blocked"
    }
]
1
2
3
4
5
6
7
8
9
10

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
2
3

GET/chats/{id}/agents

View ID of an agent

Get the name and ID of an agent by the chat identifier.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


Response 200

[
    {
        "name": "Charles",
        "id": 39704
    }
]
1
2
3
4
5
6

Response 400

{
   "reason": "This message will inform what caused the error"
}
1
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.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


Body parameters

ParameterTypeDescription
textstringMessage sent to a contact
filestringURL sent to a contact containing a fileoptional
isInternalbooleanInform if a message is internaloptional
text
string

Message sent to a contact


file
string

URL sent to a contact containing a file


isInternal
boolean

Inform if a message is internal


Request example

{
    "text": "Hello, John!",
    "file": "https://c.pzw.io/img/avatar-user-boy.jpg",
    "isInternal": false
}
1
2
3
4
5

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"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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"
}
1
2
3

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
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.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


Body parametes

ParameterTypeDescription
agentIdintegerAgent ID
messagestringMessage sent to agent at time of transferopcional
agentId
integer

Agent ID


message
string

Message sent to agent at time of transfer


Request example
{
  "agentId": 39607,
  "message": "Hello, follow the service of our customer Emanoel"
}
1
2
3
4

Response 200

{
    "customerId": "7356074",
    "chatId": 17656128
}
1
2
3
4

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
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 status 400 will be returned.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


Body parameters

ParâmetroTipoDescrição
agentIdintegerAgent ID
agentId
integer

Agent ID


{
  "agentId": 39607
}
1
2
3

Response 200

Successful request with empty body
1

Response 400

{
   "reason": "This message will inform what caused the error"
}
1
2
3

PUT/chats/{id}/read

Mark messages as read

Mark the chat message as read. An ID will be required for this.

ParameterTypeDescription
idintegerChat ID
id
integer

Exemplo: Chat ID


Response 200

Successful request with empty body
1

Resposta 403

{
   "reason": "This message will inform what caused the error"
}
1
2
3

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
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.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


Body parameters

ParameterTypeDescription
tagsstringString containing markup tags to chat
tags
string

String containing markup tags to chat


{
	"tags": "tag4, tag5, tag6"
}
1
2
3

Response 200

Successful request with empty body
1

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
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.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


Response 200

Successful request with empty body
1

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
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.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


Body parameters

ParameterTypeDescription
departmentintegerDepartment number you want to assign to chat
department
integer

Department number you want to assign to chat


{
    "department": 2546
}
1
2
3

Response 200

Successful request with empty body
1

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
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 using a tabulation and/or a thank you message, sending these parameters in the request body. When the parameter sendFeedback is set true, a thank you message is sent when a chat is closed, if this message is configured in the Huggy panel.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


Body parameters

ParâmetroTipoDescrição
tabulationintegerTabulation numberoptional
commentstringComment that will be sentoptional
sendFeedbackbooleanThank you messageoptional
tabulation
integer

Tabulation number


comment
string

Comment that will be sent


sendFeedback
boolean

Thank you message


{
	"tabulation": "12484",
	"comment": "comment through of API",
    "sendFeedback": true
}
1
2
3
4
5

Response 200

Successful request with empty body
1

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
2
3

PUT/chats/{id}/reopen

Reopen a chat

Reopen a chat, passing its ID in the request parameter.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


Response 200

Successful request with empty body
1

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
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.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


Response 400

{
   "reason": "This message will inform what caused the error"
}
1
2
3

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
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.

ParameterTypeDescription
allPagesbooleanParameter that will return all records if your value to true
allPages
boolean

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"
    }
]
1
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"
}
1
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.

ParameterTypeDescription
allPagesbooleanAgent ID
allPages
boolean

Agent ID


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"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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"
}
1
2
3

GET/agents/{id}/status

View agent status

Get the status of an agent by your ID

ParameterTypeDescription
allPagesbooleanAgent ID
allPages
boolean

Agent ID


Response 200

{
    "id": null,
    "name": "Unavailable",
    "message": null,
    "type": 0,
    "createdAt": null,
    "updatedAt": null,
    "agentID": 34146,
    "available": false
}
1
2
3
4
5
6
7
8
9
10

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
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:

DefinitionTypeKeyValue
Agentintegertype1
Managerintegertype2
Administratorintegertype3
Agent
integer

type

1


Manager
integer

type

2


Administrator
integer

type

3


Body parameters

ParameterTypeDecription
emailstringAgent email address
maxChatsintegerMaximum amount definition to a new agent
typeintegerPerfil ID of agent access
email
string

Agent email address


maxChats
integer

Maximum amount definition to a new agent


type
integer

Perfil ID 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
}
1
2
3
4
5

Response 400

{
   "reason": "This message will inform what caused the error"
}
1
2
3

Response 500

{
   "reason": "Agent already signed in"  
}
1
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.

ParameterTypeDescription
idintegerAgent status ID
id
integer

Agent status ID


Body parameters

ParameterTypeExampleDescription
idinteger0 | -1Set agent status
id
integer

Exemplo: 0 | -1

Set agent status


Request example

    "id": 0
1

Response 200

{
    "statusId": null,
    "available": true
}
1
2
3
4

Response 400

{
   "reason": "This message will inform what caused the error"
}
1
2
3

PUT/agents/{id}

Update agent

Update an agent information. Some information is required, such as: name and login.

ParameterTypeDescription
idintegerAgent ID
id
integer

Agent ID


Body parameters

ParameterTypeDescription
namestringAgent name
loginstringAgent email
phonestringAgent phone
name
string

Agent name


login
string

Agent email


phone
string

Agent phone


Request example

{
  "name": "John Doe",
  "login": "john@doe.com",
  "phone": 557599999999
}
1
2
3
4
5

Response 200

Successful request with empty body
1

Response 400

{
   "reason": "This message will inform what caused the error"
}
1
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": []
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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.

ParameterTypeDescription
idintegerContact ID
id
integer

Contact ID


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": []
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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"
}
1
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.

ParameterTypeDescription
idintegerContact ID
id
integer

Contact ID


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": ""
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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"
}
1
2
3

GET/contacts/{id}/groups

View a contact group

Get the group data that the contact belong.

ParameterTypeDescription
idintegerContact ID
id
integer

Contact ID


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"
    }
]
1
2
3
4
5
6
7
8
9
10
11

Response 400

{
   "reason": "This message will inform what caused the error"
}
1
2
3

GET/contacts/{id}/organizations

View a contact organization

Get the data of a contact organization.

ParameterTypeDescription
idintegerContact ID
id
integer

Contact ID


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": []
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
2
3

GET/contacts/{id}/customFields

View a custom field

Get the contact custom field data.

ParameterTypeDescription
idintegerContact ID
id
integer

Contact ID


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"
    }
]
1
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"
}
1
2
3

GET/contacts/{id}/linkedContacts

View contact associations

An association defines that a contact can be considered main contact of other contact.

ParameterTypeDescription
idintegerContact ID
id
integer

Contact ID


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"
            }
        ]
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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"
}
1
2
3

POST/contacts

Create a contact

To create a new contact, name and email information are required.

ParameterTypeDescription
namestringContact name
emailstringContact email
name
string

Contact name


email
string

Contact email


Requested example

{
  "name": "Charles Edware",
  "email": "test@test.com"
}
1
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": []
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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"
}
1
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.

ParameterTypeDescription
idintegerContact ID
id
integer

Contact ID


Body parameters

ParameterTypeDescription
commentstringComments inserted by agent in contact panel
comment
string

Exemplo: Comments inserted by agent in contact panel


Requested example

{
  "comment": "waiting for documents"
}
1
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
}
1
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"
}
1
2
3

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
2
3

PUT/contacts/{id}

Update a contact

Update a contact by its ID

ParameterTypeDescription
idintegerContact ID
id
integer

Contact ID


Body parameters

ParameterTypeDescription
namestringContact name
emailstringContact email
emailstringContact email
phonestringContact phone
mobilestringContact mobile
addressstringContact addressoptional
citystringContact cityoptional
districtstringContact districtoptional
statestringContact stateoptional
obsstringComment done about contactoptional
name
string

Contact name


email
string

Contact email


email
string

Contact email


phone
string

Contact phone


mobile
string

Contact mobile


address
string

Contact address


city
string

Contact city


district
string

Contact district


state
string

Contact state


obs
string

Comment done about contact


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"
}
1
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": []
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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"
}
1
2
3

DELETE/contacts/{id}

Delete a contact

Delete a contact by its ID.

ParameterTypeDescription
idintegerContact ID
id
integer

Contact ID


Response 204

Successful request with empty body
1

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
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"
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

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.

ParameterTypeDescription
allPagesbooleanParameter that will return all records if your value to trueoptional
allPages
boolean

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
    }
]
1
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"
}
1
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"
    }
]
1
2
3
4
5
6
7
8
9
10

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
2
3

GET/departments/{id}

View a department

Get the registered department information by its ID.

ParameterTypeDescription
idintegerDepartment ID
id
integer

Department ID


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"
}
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.

ParameterTypeDescription
allPagesbooleanParameter that will return all records if your value to true
allPages
boolean

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"
    }
]
1
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.

ParameterTypeDescription
idintegerTabulations ID
id
integer

Tabulations ID


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": []
}
1
2
3
4
5
6
7
8
9
10

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
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": "https://cdn.pzw.io/2d1eb9940d3ef692dfc607bb26c4d85b.png",
        "text": "Hello! Welcome to the sales department!",
        "public": true
    },
    {
        "id": "17228",
        "name": "Welcome message",
        "key": "bvwarehouse",
        "file": "https://cdn.pzw.io/2d1eb9940d3ef692dfc607bb26c4d85b.png",
        "text": "Hello! Welcome to the warehouse department!",
        "public": false
    },
    {
        "id": "17227",
        "name": "Welcome message",
        "key": "bvfinancial",
        "file": "https://cdn.pzw.io/2d1eb9940d3ef692dfc607bb26c4d85b.png",
        "text": null,
        "public": false
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

GET/shortcuts/{id}

View a shortcut

Get the shortcut data by its ID.

ParameterTypeDescription
idintegerShortcut ID
id
integer

Shortcut ID


Response 200

{
    "id": "17229",
    "name": "Welcome message",
    "key": "wmessage",
    "file": "https://cdn.pzw.io/2d1eb9940d3ef692dfc607bb26c4d85b.png",
    "text": "Hello! Welcome to the sales department!",
    "public": true
}
1
2
3
4
5
6
7
8

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
2
3

POST/shortcuts

Create a new shortcut

Creates a new shortcut for sending texts, images and files.

Note: For sending text messages, a limit of one thousand characters is reserved.

Body parameters

ParameterTypeDescription
namestringShortcut name
keystringKeyword used to call the shortcut
filestringLink to the file used in sending the shortcut
textstringA text message used in sending the shortcutoptional
publicbooleanMakes the shortcut visible on the attendance screen or in the shortcuts listoptional
name
string

Shortcut name


key
string

Keyword used to call the shortcut


file
string

Link to the file used in sending the shortcut


text
string

A text message used in sending the shortcut


public
boolean

Makes the shortcut visible on the attendance screen or in the shortcuts list


Request example

{
    "name": "Document subscription",
    "key":  "docs_sub",
    "file": "https://cdn.pzw.io/2d1eb9940d3ef692dfc607bb26c4d85b.png",
    "text": "A message that accompanies the sent document.",
    "public": true
}
1
2
3
4
5
6
7

Response 201

{
    "id": 34009,
    "name": "Document subscription",
    "key": "docs_sub",
    "file": "https://cdn.pzw.io/2d1eb9940d3ef692dfc607bb26c4d85b.png",
    "text": "A message that accompanies the sent document.",
    "public": true
}
1
2
3
4
5
6
7
8

Response 400

{
    "reason": "This message will inform what caused the error."
}
1
2
3

PUT/shortcuts/{id}

Update shortcut

Update a shortcut by its ID.

ParameterTypeDescription
idintegerShortcut ID
id
integer

Shortcut ID


Body parameters

ParameterTypeDescription
namestringShortcut name
keystringKeyword used to call the shortcut
filestringLink to the file used in sending the shortcut
textstringA text message used in sending the shortcutoptional
publicbooleanMakes the shortcut visible on the attendance screen or in the shortcuts listoptional
name
string

Shortcut name


key
string

Keyword used to call the shortcut


file
string

Link to the file used in sending the shortcut


text
string

A text message used in sending the shortcut


public
boolean

Makes the shortcut visible on the attendance screen or in the shortcuts list


Request example

{
    "name": "The new name for the shortcut",
    "key":  "keyword_new",
    "file": "https://cdn.pzw.io/2d1eb9940d3ef692dfc607bb26c4d85b.png",
    "text": "An updated message for the shortcut.",
    "public": false
}
1
2
3
4
5
6
7

Response 200

{
    "id": 34003,
    "name": "The new name for the shortcut",
    "key":  "keyword_new",
    "file": "https://cdn.pzw.io/2d1eb9940d3ef692dfc607bb26c4d85b.png",
    "text": "An updated message for the shortcut.",
    "public": false
}
1
2
3
4
5
6
7
8

Response 400

{
    "reason": "This message will inform what caused the error."
}
1
2
3

Response 404

{  
   "reason": "This message will show that doesn't exist result for your search."
}
1
2
3

DELETE/shortcuts/{id}

Delete a shortcut

Delete a shortcut by its ID.

ParameterTypeDescription
idintegerShortcut ID
id
integer

Shortcut ID


Response 204

Successful request with empty body
1

Response 404

{
   "reason": "This message will show that doesn't exist result for your search."
}
1
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
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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": []
            }
        ]
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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.

ParameterTypeDescription
idintegerWorkflow ID
id
integer

Workflow ID


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": []
        }
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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"
}
1
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"
    }
]
1
2
3
4
5
6
7
8
9
10

GET/bots/{id}

View a bot

Get the bot data by its ID.

ParameterTypeDescription
idintegerBot ID
id
integer

Bot ID


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
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
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"
    }
]
1
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.

ParameterTypeDescription
idintegerVirtual agent ID
id
integer

Virtual agent ID


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"
}
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"
}
1
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": "497786",
        "companyID": "1",
        "name": "ATENDIMENTO SYNTESIS",
        "createdBy": "3278",
        "status": "1",
        "createdAt": "2020-03-24 10:30:42",
        "updatedAt": "2020-03-24 10:30:42"
    },
    {
        "id": "497804",
        "companyID": "1",
        "name": "Conversation Page",
        "createdBy": "38736",
        "status": "1",
        "createdAt": "2020-04-07 22:25:49",
        "updatedAt": "2020-04-07 22:25:49"
    },
    {
        "id": "486288",
        "companyID": "1",
        "name": "CS Tech",
        "createdBy": "19912",
        "status": "1",
        "createdAt": "2019-04-25 14:20:54",
        "updatedAt": "2019-04-25 14:20:54"
    },
    {
        "id": "11940",
        "companyID": "1",
        "name": "Digital SDR",
        "createdBy": "46",
        "status": "1",
        "createdAt": "2019-02-23 17:48:46",
        "updatedAt": "2019-02-23 17:48:46"
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

GET/projects/{id}

View a project

Get the project data by its ID.

ParameterTypeDescription
idintegerProject ID
id
integer

Project ID


Response 200

{
    "id": "497786",
    "companyID": "1",
    "name": "ATENDIMENTO SYNTESIS",
    "createdBy": "3278",
    "status": "1",
    "createdAt": "2020-03-24 10:30:42",
    "updatedAt": "2020-03-24 10:30:42",
    "variables": {
        "Project flows": [],
        "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"
                    },
                    "custom.apelido_customer": "huggy.chat.contact.custom.apelido_customer",
                    "custom.email_customer": "huggy.chat.contact.custom.email_customer",
                    "custom.empresa_customer": "huggy.chat.contact.custom.empresa_customer"
                },
                "company": {
                    "id": "huggy.chat.company.id",
                    "name": "huggy.chat.company.name",
                    "email": "huggy.chat.company.email",
                    "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",
                "contact_last_message": "huggy.chat.contact_last_message",
                "chat_last_message": "huggy.chat.chat_last_message",
                "current_message": "huggy.chat.current_message",
                "tags": "huggy.chat.tags"
            }
        }
    },
    "variables_settings": [],
    "hasFlows": true
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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

POST/projects

Create a project

Create a project passing in the request body the attribute name and its respective value.

Body parameters

ParameterTypeDescription
namestringProject name that will be created
name
string

Project name that will be created


Requested example

{
  "name": "Electronics"
}
1
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
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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.

ParameterTypeDescription
namestringProject ID
name
string

Project ID


Body parameters

ParameterTypeDescription
namestringNew name to project
name
string

New name to project


Requested example

{
  "name": "Electronics"
}
1
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
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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"
}
1
2
3

DELETE/projects/{id}

Delete a project

Delete a project by its ID.

ParameterTypeDescription
idintegerProject ID
id
integer

Project ID


Response 200

{
    "status": true
}
1
2
3

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
2
3

GET/projects/{id}/flows

View all project flows

Get the list of all project flows and its configured actions.

ParameterTypeDescription
idintegerProject ID
id
integer

Project ID


Response 200

[
    {
        "id": "67356",
        "token": "bd8868c5-f816-460b-ab25-631ea0696f10",
        "description": "segunda via boleto",
        "createdAt": "2020-03-24 10:36:24",
        "updatedAt": "2020-03-24 10:36:24",
        "status": "1",
        "companyID": "1",
        "createdBy": null,
        "importStatus": "0",
        "projectID": "497786",
        "importedBy": null,
        "deletedBy": null,
        "deletedAt": null,
        "actions": [],
        "variables": []
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

GET/projects/{projectId}/flows/{flowId}

View a flow

Get the flow data by its ID.

ParameterTypeDescription
projectIdintegerProject IDoptional
flowIdintegerFlow ID
projectId
integer

Project ID


flowId
integer

Flow ID


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": []
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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.

ParameterTypeDescription
idintegerProject ID
id
integer

Project ID


Body parameters

ParameterTypeDescription
descriptionstringFlow description to be created
description
string

Flow description to be created


Requested example

{
  "description": "tracking"
}
1
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": []
}
1
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"
}
1
2
3

PUT/projects/{projectId}/flows/{flowId}

Update a flow

Update the flow description.

ParameterTypeDescription
projectIdintegerProject ID
flowIdintegerProject flow number
projectId
integer

Project ID


flowId
integer

Project flow number


Body parameters

ParameterTypeDescription
descriptionintegerThe new description flow
description
integer

The new description flow


Requested example

{
  "description": "New description"
}
1
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": []
}
1
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"
}
1
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.

ParameterTypeDescription
projectIdintegerProject ID
flowIdintegerFlow ID
projectId
integer

Project ID


flowId
integer

Flow ID


Response 204

{
Successful request with empty body
}
1
2
3

Response 400

{
   "reason": "This message will inform what caused the error"
}
1
2
3

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}
1
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": []
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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.

Body parameters

ParameterTypeDescription
namestringOrganization name
name
string

Organization name


Requested example

{
  "name": "Huggy"
}
1
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": []
}
1
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"
}
1
2
3

PUT/organizations/{Id}

Update a organization

Update the organization name.

ParameterTypeDescription
idintegerOrganization ID
id
integer

Organization ID


Body parameters

ParameterTypeDescription
namestringNew organization name
name
string

New organization name


Requested example

{
  "name": "Huggy"
}
1
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": []
}
1
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"
}
1
2
3

DELETE/organizations/{Id}

Delete a organization

Delete a organization by its ID.

ParameterTypeDescription
idintegerOrganization ID
id
integer

Organization ID


Response 204

Successful request with empty body
1

Response 404

{
   "reason": "This message will show that doesn't exist result for your search"
}

1
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"
    }
]
1
2
3
4
5
6
7
8
9
10

Types