Types of requests


Create a ticket

Parameter Value

secret

application id

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

application id

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:

ParameterValue

secret

application id
idcomment's id
messagethe 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_idid 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

deliveredwhether the message has been delivered (not implemented)
readedwhether 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:

ParameterValue

secret

application id
idrating id
client_idclient's id
ticket_idticket's id
rating

The rating is given by the client:

1 — poor
2 — normal
3 — good

company_idid of the company (account) from which the webhook came
ticket_comment_idrating's comment id
commentcomment to the rating
created_atdate the rating was created
updated_atrating update date
user_idid 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"
    }
}