Types of requests


Create a ticket

Parameter Value

secret

API channel's token

id

ticket id
status_id

ticket's status id

List of possible statuses:

  • 1 (open)
  • 2 (completed)
  • 3 (closed)
  • 4 (deleted)
  • 5 (on hold)
  • 6 (pending)
  • 7 (spam)
  • 8 (new)
  • 9 (mailing)
subject

Ticket subject

client_id client's ID
assignee_id id of the executor (agent)
group executer's id of the group
last_updated_at last ticket modification date
channel_id channel id
email clien't mail adress (from which he wrote)
published_at ticket's creation date
company_id company's id (account) which the webhook came
additional_id additional ticket ID
message text of the client's message
custom_fields

List of fields and their values. Sent only when at least one of the fields is additional.

Contains parameters:

  • id — add id. fields
  • name — name of add. fields
  • value — additional value. fields
  • custom_blocks
custom_blocks

List of additional system blocks, which contains parameters:

  • name — the name of the block
  • url — url of the block
  • secret_key — secret token of the block

Example of a response from server
{
    "secret":"0e8f678d8327eb3292a28c8165957b282a1b2f8b",
    "ticket":{
        "id":"2261907",
        "status_id":"1",
        "subject":"First msg",
        "client_id":"242630",
        "assignee_id":null,
        "group":"0",
        "last_updated_at":"2016-12-17 14:07:33",
        "email":"jon@bonjovi.com",
        "published_at":"2016-12-17 14:07:33",
        "company_id":"153561",
        "additional_id":"123Ca344",
        "custom_fields":[
            {
                "id":54,
                "name":"new item 2",
                "value":null
            }
        ],
        "custom_blocks":[
            {
                "name":"Test",
                "url":"test",
                "secret_key":"dsf4354f=-213sdfasdsa"
            }
        ]
    }
}
		


Change a ticket

When a ticket is changed, the system sends a webhook that contains:

Parameter Value

secret

api channel's token

id

id of the ticket's changing event
trigger_id

id rule that changed the request
If "null" means the request was changed by the user

user_id

id of the user who changed the request
If "null" means the request changed the rule

ticket_id ticket's id
data

The array of changes that were applied to the ticket contains the parameters:

  • target — which field was changed
  • value — what value the field was changed to
  • old_value — from what value the field was changed
changed_at

date of change

old_status id of the previous ticket status
new_status id of the new ticket status
company_id id of the company (account) from which the webhook came
custom_fields

List of fields and their values. Sent only when at least one of the fields is additional.

Contains parameters:

  • id — add id. fields
  • name — name of add. fields
  • value — additional value. fields
  • custom_blocks
custom_blocks

List of additional system blocks, which contains parameters:

  • name — the name of the block
  • url — url of the block
  • secret_key — secret token of the block
client

Client information. Contains parameters:

  • id
  • name — name
  • avatar — avatar
  • note — note
  • emails — email address
  • phones — phone
  • additional_ids — additional ID

Example of a response from server
{
    "secret":"0e8f678d8327eb3292a28c8165957b282a1b2f8b",
    "custom_fields":[
        {
            "id":54,
            "name":"new item 2",
            "value":null
        }
    ],
    "custom_blocks":[
        {
            "name":"Test",
            "url":"test",
            "secret_key":"dsf4354f=-213sdfasdsa"
        }
    ],
    "trigger":{
        "id":"204232",
        "trigger_id":null,
        "user_id":"2",
        "ticket_id":"2261907",
        "data":[
            {
                "target":"subject",
                "value":"POST UPDATE"
            },
            {
                "target":"status_id",
                "value":"2"
            },
            {
                "target":"priority",
                "value":"medium"
            },
            {
                "target":"type",
                "value":"task"
            }
        ],
        "changed_at":"2016-12-17 14:11:53",
        "old_status":"1",
        "new_status":"2",
        "company_id":"153561"
    }
}
		


Create a comment

When you write a comment in a ticket, the system sends a webhook that contains:

Parameter Value

secret

api channel's token
id comment's id
message the text of the message that was sent
type
  • Message type:
    private — internal
    public — public
from

the messages author

  • user — agent
  • client — client

Important: if a message is sent via a trigger (bot), a new message webhook will not be sent. A webhook will be sent to update the request.

user_id

id of the user who wrote the message


If "null" means the comment was written by the client

client_id

id of the client who wrote the message


If "null" means the comment was written by the user

ticket_id id of the ticket in which the comment was written
is_first

1 — if the comment is the first in the ticket
0 — if the comment is not the first in the ticket

delivered whether the message has been delivered (not implemented)
readed whether the message has been read (not implemented)
published_at сomment creation date
custom_fields

list of fields and their values. Contains parameters:

  • id — add id. fields
  • name — name of add. fields
  • value — additional value. fields
client

Client information. Contains parameters:

  • id
  • name — name
  • avatar — avatar
  • note — note
  • emails — email address
  • phones — phone
  • additional_ids — additional ID

Example of a response from server
{
    "secret":"0e8f678d8327eb3292a28c8165957b282a1b2f8b",
    "comment":{
        "id":"2652657",
        "message":"New message text",
        "from":"user",
        "user_id":"545",
        "client_id":null,
        "ticket_id":"2261907",
        "is_first":"0",
        "delivered":"0",
        "readed":"0",
        "published_at":"2016-12-17 14:14:37"
    }
}
		


User rating

When receiving a rate in a ticket, the system sends a webhook that contains:

Parameter Value

secret

api channel's token
id rating id
client_id client's id
ticket_id ticket's id
rating

The rating is given by the client:

1 — poor
2 — normal
3 — good

company_id id of the company (account) from which the webhook came
ticket_comment_id rating's comment id
comment comment to the rating
created_at date the rating was created
updated_at rating update date
user_id id of the request executor

Example of a response from server
{
    "secret":"0e8f678d8327eb3292a28c8165957b282a1b2f8b",
    "csi":{
        "id":"2652657",
        "comment":"New message text",
        "user_id":"545",
        "client_id":123213,
        "ticket_id":"2261907",
        "rating":"3",
        "created_at":"2016-12-17 14:14:37"
    }
}