POST and GET requests

POST and GET requests can be formed with the system triggers.


GET Request

In the "To do" block you must select GET request.
As the values of the parameter you must specify the address to which the request will be sent when the specified conditions are met:

GET request example

https://api.telegram.org/bot610652777:AAFxSSwIeshFf1FjJQElLXTbbh-U7qwEFnY/sendMessage?chat_id=-224546715&text="тест"


You can also use text field variables in the address:

Example GET request with text field variables

https://example.com/crm?company="{{company_name}}"&subject="{{ticket_subject}}"


POST Request

In the "To do" block you should select POST request.
The structure of the action consists of parameters: url — address to which the request should be sent, data — request body and headers — request headers:
POST request structure
{
    "url": "https://example.com/post-example",
    "data": {
       "param1":"value1",
       "param2":"value2"
    },
    "headers": [
      "header1: value1"
    ]
}


POST requests support both one-dimensional and multi-dimensional arrays “data” and also take into account headers, if they are obligatory in the API of your system.

POST request example
{
    "url": "https://webhook.site/0beb0b35-e145-4901-8047-39e228e8db3b",
    "data": {
        "attachments": [
            {
                "title": "New Message For U",
                "fields": [
                    {
                        "title": "Client",
                        "value": "{{client_email}}",
                        "short": true
                    },
                    {
                        "title": "Reason",
                        "value": "{{ticket_field__1291}}",
                        "short": true
                    },
                    {
                        "title": "Text of message",
                        "value": "{{ticket_message_last}}  ",
                        "short": false
                    }
                ],
            "color": "#764FA5"
            }
        ]
    },
    "headers": [
      "subject: {{ticket_subject}}",
      "client_email: {{client_email}}",
      "platform: MOBILE_APP"
      "token: app_secret=\"1234567890qwerty\""
    ]
}