Additional blocks

Additional sections are divided into two types:

Static blocks

It displays static information. At the section settings, the information (text) is set and displayed on each ticket. The text supports various ticket variables.


Dynamic blocks

It makes a request to the url specified in its settings and renders the content that is returned to it at response.

Expected response format: json

The structure of the expected response:

{ 
"html": "Any HTML"
}


If the secret key is specified it is added to the request url: https://site.com/?secret_key=$key, where $key - secret key

By default, the response will be designed in accordance with the styles of Usedesk, there is support for bootstrap. Also, the answer may contain your own styles added to html.
The response timeout is 60 seconds. Above each dynamic blocks there is a “refresh” button, which repeats the request and reloads the data into the blocks.
Request Parameter Description:

Parameter Value
ticket_idTicket ID in Usedesk
subjectTicket subject
client_idClient ID in Usedesk
contactСontact data
channel_type

The type of channel to which the request came. Not recommended to use (version 1.0)

Deprecated (version 1.0): Not recommended. Working with the channel type is put into the channel_data parameter

channel_idChannel ID in Usedesk
from_email

Parameter that shows if the request came from an email channel

Deprecated (version 1.0): Not recommended. Working with the channel type is put into the channel_data parameter

from_id

Parameter that shows ID if the request came from another system

Deprecated (version 1.0): Not recommended. Working with the channel type is put into the channel_data parameter

client_data

Array with client data in UseDesk

ParameterValue
nameClient name
emailsArray with client emails
phones

Array with client phones

ParameterValue
typePhone type ('home','mobile','stationary','fax','other')
phonePhone number
social_services

List of client’s accounts at the social networks

Parameter Value
typeSocial network type ('twitter','facebook','vk','ok','instagram','youtube','gplus','other')
urlClient's address at the social network
addresses

Client's physical addresses

ParameterValue
countryCountry
cityCity
addressaddress
typetype ('home','work','postal')
messengers

Client’s messengers

ParameterValue
typetype ('imessage','skype','whatsapp','gtalk','telegram','other','jivo')
idClient’s messenger id
sitesList of client’s sites
companyClient’s company
channel_dataArray with channel data in Usedesk (version 2.0)
ParameterValue
type

channel type

  • email
  • telephony
  • chat
  • whatsapp
  • telegram
  • twitter
  • vk
  • ok
  • instagram
  • viber
  • facebook
  • sdk

data

channel data

  • email: email address
  • telephony: telephone number
  • chat: email address if requested to chat
  • whatsapp: telephone number
  • telegram: 12345678
  • twitter: group page address
  • vk: group page address
  • ok: id chat
  • instagram: account name
  • viber: id
  • facebook: id
  • sdk: email address if requested to chat

** UID - priority if it does not return the above data

idaccount id of the channel

Request example
{
    "ticket_id": 2252750,
    "subject": "Hello!",
    "client_id": 151869,
    "channel_type": "email",
    "channel_id": 492,
    "from_email": test@gmail.com,
    "client_data": {
        "name": "George Benson",
        "emails": [
            "test@gmail.com",
            "test_work@gmail.com"
        ],
        "phones": [
            {
                "type": "home",
                "phone": "+1 111 111-11-11 #111"
            },
            {
                "type": "mobile",
                "phone": "+2 222 222-22-22 #222"
            }
        ],
        "social_services": [
            {
                "type": "facebook",
                "url": "https://facebook.com/123124124124124214",
                "uid": null
            }
        ],
        "addresses": [
            {
                "country": "Russia",
                "city": "Moscow",
                "address": "4 apt., Flower street",
                "type": "home"
            }
        ],
        "messengers": [
            {
                "type": "telegram",
                "id": "1234"
            }
        ],
        "sites": [
            "http://site.com"
        ],
        "company": "Black and White"
     },
  "channel_data": {
    "type": "chat",
    "data": "test@gmail.com",
    "id": 1111111
  }
}