API v2

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/v2, 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

The authentication of APIv2 is made upon the token of access that can by which can be purchased by a platform accountde, as shown in the image below:

Autenticação APIv2

For this, you must provider a header of authorization in each request made, following the format:

    X-Authorization: Bearer xxxxxxxxxx
1

Headers

All requests must also include the following headers:

  • Content-Type: application/json
  • Accept: application/json
  • Authorization: Bearer xxxxxxx

Request

APIv2 requests have the URL model https://api.huggy.app/v2/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.

Practical examples

Agentes

GET/agents

List all agents

Get the list of all company agents.

Response 200

[
    {
        "id": 12162,
        "name": "John Doe"
    },
    {
        "id": 11839,
        "name": "Nicolas Tesla"
    },
    {
        "id": 11433,
        "name": "Linus Torvalds"
    },
    {
        "id": 11432,
        "name": "Dennis Ritchie"
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

GET/agents/{id}

View an agent detail

Gets an agent's data by its ID.

ParameterTypeDescription
idintegerAgent ID
id
integer

Exemplo: Agent ID


Response 200

{
    "id": "34146",
    "name": "John Doe",
    "email": "john@doe.com",
    "login": "johndoe",
    "type": 3,
    "phone": "551199999999"
}
1
2
3
4
5
6
7
8

Response 400

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

POST/agents

Create a new agent

Invite a new agent for Huggy platform.

Note: A new agent will only be visible after accepting email confirmation.

ParameterTypeDescription
emailstringEmail of new agent
typeintegerAgent access scope definition
email
string

Exemplo: Email of new agent


type
integer

Exemplo: Agent access scope definition


Request Example

{
  "email": "john@doe.com",
  "type": 1
}
1
2
3
4

An agent is defined for your access perfil, this is represented for attribute type that receive a numeric value, at whare:

DefinitionTypeKeyValue
AgentintegerType1
GerenteintegerType2
AdministradorintegerType3
Agent
integer

Exemplo: Type

1


Gerente
integer

Exemplo: Type

2


Administrador
integer

Exemplo: Type

3


Response 400

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

Response 500

{
    "reason": "agent already logged in"
}
1
2
3

PUT/agents/{id}

Update a agent

Update the agent data.

Note: This field password must have less than eight characters.

ParameterTypeDescription
idintegerAgent ID
id
integer

Exemplo: Agent ID


Body parameters

ParameterTypeDescription
namestringAgent name
loginstringAgent login
emailstringAgent email addressoptional
passwordstringAgent passwordoptional
typeintegerAgent scope definitionoptional
phonestringAgent phoneoptional
activebooleanDefinition of activity of agent in plataformoptional
name
string

Exemplo: Agent name


login
string

Exemplo: Agent login


email
string

Exemplo: Agent email address

optional


password
string

Exemplo: Agent password

optional


type
integer

Exemplo: Agent scope definition

optional


phone
string

Exemplo: Agent phone

optional


active
boolean

Exemplo: Definition of activity of agent in plataform

optional


Request Example

    {        
        "name": "John Doe",        
        "login": "johndoe",
        "email": "john@doe.com",
        "password": "12345678",
        "type": 2,
        "phone": "551199999999",
        "active": true
    }
1
2
3
4
5
6
7
8
9

Response 400

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

Contatos

GET/contacts

List all contacts

Get the list of all contacts.

✔️ See how to export your contacts to a spreadsheet using this endpoint.

Note: The return of payload of this request have an attribute customFields. A list that empty returned if you does not have custom field registred.

Response 200

[
    {
        "id": 8307934,
        "name": "John",
        "email": john@doe.com,
        "mobile": 1199999999,
        "phone": 1133333333,
        "customFields": []
    },
    {
        "id": 8227983,
        "name": "Tesla",
        "email": "nicolas@tesla.com",
        "mobile": "1199999999",
        "phone": "1133333333",
        "birthday": null,
        "customFields": {
            "segundo_email_customer": "nicolas@dev.com",
            "cpf_customer": "03600000041",
            "data_customer": "14/10/2019",
            "hora_customer": "20:30",
            "numero_customer": "104",
            "perfil_customer": "Nivel 5",
            "telefone_customer": "+557599999999",
            "cnpj_customer": "00.000.000/0001-00"
        }
    }
]
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

GET/contacts/{id}

View a contact details

Get the data of a contact by your ID.

ParameterTypeDescription
idintegerContact ID
id
integer

Exemplo: Contact ID


Response 200

{
    "id": 8227983,
    "name": "John",
    "email": "john@doe.com",
    "mobile": "1199999999",
    "phone": "1133333333",
    "birthday": null,
    "customFields": {
        "segundo_email_customer": "john@doe.com",
        "cpf_customer": "03600000041",
        "data_customer": "14/10/2019",
        "hora_customer": "20:30",
        "numero_customer": "104",
        "perfil_customer": "Nivel 5",
        "telefone_customer": "+551199999999",
        "cnpj_customer": "00.000.000/0001-00"
    },
    "channels": {
        "voip": true,
        "messenger": false,
        "widget": false,
        "whatsapp": false,
        "email": true,
        "sms": true,
        "telegramBot": false,
        "whatsappApi": false,
        "instagram": 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

POST/contacts

Creates a new contact

Note: All parameters are required in the request body

Body parameters

ParameterTypeDescription
namestringContact name
phonestringContact phone
emailstringContact email
name
string

Exemplo: Contact name


phone
string

Exemplo: Contact phone


email
string

Exemplo: Contact email


Request example

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

Response 201

[
    {
        "id": "16156013",
        "whatsappID": null,
        "name": "John Doe",
        "companyID": "15691",
        "email": "John@doe.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": "2020-06-25 11:19:56",
        "createdAt": "2020-06-25 11:20:56",
        "updatedAt": null,
        "status": 1,
        "lastSync": null,
        "syncWhatsapp": null,
        "lastChatID": null,
        "tokens": null,
        "mobile": null,
        "phone": "557599999999",
        "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,
            "whatsapp": false,
            "email": true,
            "sms": false,
            "telegramBot": false,
            "whatsappApi": false,
            "instagram": false
        },
        "customFields": {
            "1199": null,
            "1194": null,
            "1195": null,
            "1196": null,
            "1197": null,
            "1200": null,
            "1193": null,
            "1192": null,
            "1198": null
        },
        "custom_fields": {
            "1199": null,
            "1194": null,
            "1195": null,
            "1196": null,
            "1197": null,
            "1200": null,
            "1193": null,
            "1192": null,
            "1198": null
        },
        "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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

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 your ID.

ParameterTypeDescription
idintegerContact ID
id
integer

Exemplo: Contact ID


Body parameters

ParameterTypeDescription
namestringNome do contato
namestringContact name
emailstringContact email
phonestringContact phoneopcional
mobilestringContact mobileopcional
addressstringContact addressopcional
citystringContact cityopcional
districtstringContact districtopcional
statestringContact stateopcional
obsstringCommentsopcional
name
string

Exemplo: Nome do contato


name
string

Exemplo: Contact name


email
string

Exemplo: Contact email


phone
string

Exemplo: Contact phone

opcional


mobile
string

Exemplo: Contact mobile

opcional


address
string

Exemplo: Contact address

opcional


city
string

Exemplo: Contact city

opcional


district
string

Exemplo: Contact district

opcional


state
string

Exemplo: Contact state

opcional


obs
string

Exemplo: Comments

opcional


Note: Among the attributes that must be passed in the request body, name, email or phone is required.

Request Example

{  
  "name": "john Doe",  
  "email": "john@doe.com",
  "mobile": "1199999999", 
  "phone": "1133333333",
  "address": "Rua Roque Petroni JR",
  "city": "São Paulo",
  "district": "Morumbi",
  "state": "São Paulo",
  "obs": "This is a field for added subjects about the contact"
}
1
2
3
4
5
6
7
8
9
10
11

Response 204

Successful request with empty body
1

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/contacts/{id}

Delete a contact

Delete a contact by your ID.

ParameterTypeDescription
idintegerContact ID
id
integer

Exemplo: Contact ID


Request Example

{

}
1
2
3

Response 204

Successful request with empty body
1

Chats

GET/chats

List all chats

Get the list of all chats.

Response 200

[
    {
        "id": 13123230,
        "agentId": 34146,
        "secondAgentId": 8792,
        "contactId": null,
        "siteCustomerId": null,
        "messengerId": null,
        "departmentId": null,
        "tabulationId": null,
        "channels": [],
        "queueNumber": null,
        "createdAt": "2019-10-29 16:06:00",
        "updatedAt": "2019-10-29 16:06:00",
        "attendedAt": null,
        "closedAt": null
    },
    {
        "id": 13123115,
        "agentId": 34146,
        "secondAgentId": null,
        "contactId": 5081376,
        "siteCustomerId": null,
        "messengerId": null,
        "departmentId": null,
        "tabulationId": null,
        "channels": [
            {
                "uuid": "325c3456-9981-43f5-8705-xxxxxxxxxxxx",
                "id": "john@doe.com",
                "name": "John Doe",
                "type": "Email"
            }
        ],
        "queueNumber": null,
        "createdAt": "2019-10-24 15:22:50",
        "updatedAt": "2019-10-24 15:23:00",
        "attendedAt": "2019-10-24 15:22:54",
        "closedAt": null
    },
    {
        "id": 13119881,
        "agentId": 34146,
        "secondAgentId": null,
        "contactId": 5081359,
        "siteCustomerId": null,
        "messengerId": null,
        "departmentId": null,
        "tabulationId": null,
        "channels": [
            {
                "uuid": "325c3456-9981-43f5-8705-xxxxxxxxxxxx",
                "id": "john@doe.com",
                "name": "John Doe",
                "type": "Email"
            }
        ],
        "queueNumber": null,
        "createdAt": "2019-06-11 11:44:10",
        "updatedAt": "2019-06-11 11:44:33",
        "attendedAt": "2019-06-11 11:44:14",
        "closedAt": 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
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

GET/chats/{id}

View chat details

Get the detailed data of a chat by its ID.

Resposta 200

{
    "id": 13124123,
    "agentId": 34146,
    "secondAgentId": null,
    "contactId": null,
    "siteCustomerId": 1842168,
    "messengerId": null,
    "departmentId": null,
    "tabulationId": null,
    "channels": [
        {
            "uuid": "193e8c7d-7071-47ef-9c3b-0809196a8192",
            "id": 6944,
            "name": "Widget",
            "type": "Widget"
        }
    ],
    "queueNumber": null,
    "createdAt": "2019-12-05 16:22:14",
    "updatedAt": "2019-12-05 16:45:28",
    "attendedAt": "2019-12-05 16:22:27",
    "closedAt": "2019-12-05 16:45:28"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

GET/chats/{id}/messages

List chat messages

Get all messages of a chat by your ID.

ParameterTypeDescription
idintegerChat ID
id
integer

Exemplo: Chat ID


Response 200

[
    {
        "id": 539800462,
        "body": "Hello Stallman",
        "is_internal": false,
        "is_email": true,
        "sender": {
            "id": 40419,
            "name": "John Doe",
            "mobile": "11999999999",
            "phone": "1133333333",
            "email": "john@doe.com",
            "photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
        },
        "senderType": "agent",
        "receiver": {
            "id": 8227983,
            "name": "Stallman",
            "mobile": "1199999999",
            "phone": "1133333333",
            "email": "richard@stallman.com",
            "photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
        },
        "receiverType": "email",
        "file": null,
        "channel": "email",
        "customer": {
            "id": 8227983,
            "name": "Stallman",
            "mobile": "1188888888",
            "phone": "1144444444",
            "email": "richard@stallman.com",
            "photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
        },
        "chat": {
            "id": 22797236,
            "channel": "email",
            "situation": "in_chat",
            "department": false,
            "customer": {
                "id": 8227983,
                "name": "Stallman",
                "mobile": "1188888888",
                "phone": "1144444444",
                "email": "richard@stallman.com",
                "photo": "https://c.pzw.io/img/avatar-user-boy.jpg"
            }
        },
        "send_at": "2019-10-24 14:53:52",
        "read_at": null,
        "type": "0",
        "eventType": 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
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

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

GET/chats/{id}/feedback

View satisfaction survey

Get the note and the message of satisfaction survery of informed chat.

ParameterTypeDescription
idintegerChat ID
id
integer

Exemplo: Chat ID


Response 200

{
    "score": "5",
    "text": "We were very happy with the service"
}
1
2
3
4

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/{channel}

Create a new chat

Create a new chat in platform, passing the email chanel with url parameter.

Note: When the channelID parameter is not informed, will be considered the channelID of the main account.

ParameterTypeDescription
namestringContact name
phonestringContact phone
emailstringContact email address
channelIDintegerChannel IDoptional
messagestringSend message in call openedoptional
departmentintegerDepartment IDoptional
subjectstringSubject messageoptional
isInternalbooleanInform if the chat is internaloptional
name
string

Exemplo: Contact name


phone
string

Exemplo: Contact phone


email
string

Exemplo: Contact email address


channelID
integer

Exemplo: Channel ID

optional


message
string

Exemplo: Send message in call opened

optional


department
integer

Exemplo: Department ID

optional


subject
string

Exemplo: Subject message

optional


isInternal
boolean

Exemplo: Inform if the chat is internal

optional


Request Example

{
    "name": "John Doe",
    "phone": "551199999999",
    "email": "john@doe.com",
    "message": "Hello, John!"
}
1
2
3
4
5
6

Response 201

{
    "id": 38247402,
    "agentId": 3193,
    "secondAgentId": null,
    "contactId": 16276830,
    "siteCustomerId": null,
    "messengerId": null,
    "departmentId": null,
    "tabulationId": null,
    "channels": [
        {
            "uuid": "89a482f8-f15b-11e8-7969-0ee2o7d4bad8",
            "id": "johndoe@huggy.io",
            "name": "John Doe",
            "type": "Email"
        }
    ],
    "workflowID": null,
    "workflowStepID": null,
    "queueNumber": null,
    "createdAt": "2020-06-30 10:58:15",
    "updatedAt": "2020-10-09 12:13:15",
    "attendedAt": "2020-08-07 10:09:39",
    "closedAt": 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

Response 400

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

POST/chats/{id}/close

Close a chat

End a chat call by your ID.

Note: Define the parameter sendFeedback with true when you want the user to evaluate the service.

ParameterTypeDescription
idintegerChat ID
id
integer

Exemplo: Chat ID


Request Example

{
    "sendFeedback": true
}
1
2
3

Response 201

Successful request with empty body
1

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}/queue

Put chat on queue

Put a chat in queue by your ID.

Note: Only chats that are in attendance by an agent can be queued.

ParameterTypeDescription
idintegerChat ID
id
integer

Exemplo: Chat ID


Response 201

Successful request with empty body
1

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}/messages

Add new message in chat

Send a message for a chat. Set the isInternal parameter to true when you want to send an internal message to the chat.

ParameterTypeDescription
idintegerChat ID
id
integer

Exemplo: Chat ID


Body parameters

ParameterTypeDescription
textstringText message send to chat
isInternalbooleanInform if the chat is internal
text
string

Exemplo: Text message send to chat


isInternal
boolean

Exemplo: Inform if the chat is internal


Request Example

{
    "text": "Hello John!",
    "isInternal": false
}
1
2
3
4

Response 201

Successful request with empty body
1

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}/reopen

Reopen a chat

Reopen a chat by passing its ID as a parameter in the request.

ParameterTypeDescription
idintegerChat ID
id
integer

Chat ID


Response 201

Successful request with empty body
1

Response 404

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

POST /chats/{id}/situation

Change chat situation

Change a chat situation by your ID.

ParameterTypeDescription
idintegerChat ID
id
integer

Exemplo: Chat ID


Body parameters

ParameterTypeDescription
autostringChat in automatic distribution
wait_for_chatstringChat waiting for attendance
in_chatstringChat in attendance
blockedstringChat blocked for attendance
auto
string

Exemplo: Chat in automatic distribution


wait_for_chat
string

Exemplo: Chat waiting for attendance


in_chat
string

Exemplo: Chat in attendance


blocked
string

Exemplo: Chat blocked for attendance


Request Example

{
    "situation": "wait_for_chat"
}
1
2
3

Response 201

Successful request with empty body
1

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}/tags

Define tags

Note: For the definition of more of a one tag, separate its per comma.

ParameterTypeDescription
idintegerChat ID
id
integer

Exemplo: Chat ID


Body parameters

ParameterTypeDescription
tagsstringTags that represents the subject of a determinate interaction
tags
string

Exemplo: Tags that represents the subject of a determinate interaction


Request Example

{
    "tags" : "tag1, tag2"
}
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

POST/chats/{id}/flow

Execute flow

Run a Flow from a chat that is not finalized or is not internal. If the chat already has a Flow in process, it will be aborted and the execution of the new Flow will be started.

ParameterTypeDescription
idintegerChat ID
id
integer

Exemplo: Chat ID


Body parameters

ParameterTypeDescription
flowIdintegerFlow ID
flowId
integer

Exemplo: Flow ID


Request Example

{
    "flowId" : 142714
}
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

Response 404

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

Flows

POST/flows/{flowId}/contact/{contactId}/exec

Execute a Flow to a contact

Initialize the execution of a Flow to a specific contact.

Channels that can use this resource:

  • Email
  • Messenger
  • TelegramBot
  • Whatsapp

To specify the channel that will be used to execute the Flow, it is necessary to send the uuid. This uuid is the universal identifier of the channel. The value of the uuid can be obtained at the Huggy panel bellow the section: Configuration >> Channels >> Channel Details.

Besides the uuid, there is more 4 attributes that can be provide during the request:

variables ( object )

Corresponds to the fields that can be used during Flow execution.

"variables": { 
    "data": "15/10/2019",
    "url_event": "https://huggy.io"
}
1
2
3
4

Running example

At the variables declaration above, there is two terms that can be used during the Flow execution: data and url_evento. For these two terms to be used it is necessary to inform them in some part of the flow's action, for example, in the action of sending message.

When sending a message with the following text:

"Hello, good afternoon. The event will be on . The access link is the following: ".

The system will replace the terms data and url_event by the values provided at the variables declaration, being as fllows:

"Hello, good afternoon. The event will be on 15/10/2019. The access link is the following: https://huggy.io".

Note: default { }


whenInChat ( true | false )

If the chat is in attendance with the agent, the following conditions will be considered:

  • true: Execute the Flow and remove the agent from the conversation (the chat will come back to the automatic status).

  • false: Do not execute the Flow.

Note: default false


whenWaitForChat ( true | false )

If the chat is waiting on the queue, the following conditions will be considered:

  • true: Do not execute the Flow.

  • false: The chat will come back to the automatic status.

Note: default false


whenInAuto ( true | false )

If it is on automatic and/or hold another Flow im process, the following conditions will be considered:

  • true: Abort the actual Flow and initialize the execution of the provided Flow.

  • false: Do nothing.

Observations:
For the right operation of this resource in the channels Messenger and TelegramBot the provided contact must have a link with the company, that is, it is necessary that the contact has already done some service with the company through the mentioned channels.

  • In the case of whatsapp channel, it is possible to run the flow without previous service. However, the contact's phone number must be valid: Country Area Code (55-Brazil) + Area Code (DDD) + Phone Number. Ex. 5511988886666.

  • If any of the four attributes above explained is not provided at the request, the system will pick up the default value of each one.

  • If there is no open chat with the contact, a new chat will be created.

ParameterTypeDescription
flowIdintegerFlow ID
contactIdintegerContact ID
flowId
integer

Exemplo: Flow ID


contactId
integer

Exemplo: Contact ID


Request Example

{
  "uuid": "",
  "variables": {
    "data": "15/10/2019",
    "url_event": "https://huggy.io"
  },
  "whenInChat": true,
  "whenWaitForChat": true,
  "whenInAuto": true
}
1
2
3
4
5
6
7
8
9
10

Response 200

{
    "reason": "Flow processed",
    "chatID": 19291350
}            
1
2
3
4

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