{"id":340101,"date":"2022-10-22T15:00:21","date_gmt":"2022-10-22T15:00:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=340101"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=340101","title":{"rendered":"<span>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 REST a\u0441tivity (\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439) \u0411\u0438\u0442\u0440\u0438\u043a\u044124 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c-\u0432\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u0434\u043b\u044f \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0438\u043b\u0438 activity \u0432 \u0411\u0438\u0442\u0440\u0438\u043a\u044124 \u2013 \u044d\u0442\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435.  <\/p>\n<p>\u0412 REST API \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 \u201cbizproc.activity.add\u201d, \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0438 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u0434\u043b\u044f \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e\u0440\u0442\u0430\u043b\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u00ab\u0444\u0440\u043e\u043d\u0442\u00bb \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0432\u0430\u0448\u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 (\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443, \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435) \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0438 \u0441 \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0438\u0437 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432, \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0438\u0441\u043a\u0430 id \u0438\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u043b\u0435).<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043c\u0430\u0440\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c REST, php, js. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c vue.js, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0433\u043b\u0430\u0432\u043d\u043e\u0435 &#8212; \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 ajax \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0418, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043f\u043e https.<\/p>\n<hr\/>\n<h2>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430<\/h2>\n<p>\u041d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 3 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<p>1. <strong>index.php<\/strong> \u2013 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438;<\/p>\n<details class=\"spoiler\">\n<summary>index.php<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"php\">&lt;?php header('Content-Type: text\/html; charset=UTF-8');  $protocol = $_SERVER['SERVER_PORT'] == '443' ? 'https' : 'http'; $host = explode(':', $_SERVER['HTTP_HOST']); $host = $host[0];  define('BP_APP_HANDLER', $protocol.':\/\/'.$host.explode('?', $_SERVER['REQUEST_URI'])[0]); ?> &lt;!DOCTYPE html> &lt;html lang=\"en\">     &lt;head>         &lt;meta charset=\"UTF-8\">         &lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">         &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">         &lt;script src=\"\/\/api.bitrix24.com\/api\/v1\/\">&lt;\/script>         &lt;link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.2\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-EVSTQN3\/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC\" crossorigin=\"anonymous\">     &lt;\/head>     &lt;body>         &lt;h1 style=\"text-align: center;margin-bottom: 2rem;width: 100%\">\u0410\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u043e\u043f\u0442\u0438\u043c&lt;\/h1>         &lt;div style=\"margin-left: 30px;max-width: 26rem;\">             &lt;div class=\"item\">                 &lt;h3 style=\"text-align: center;\">\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0421\u041f\"&lt;\/h3>                 &lt;button class=\"btn btn-primary\" style=\"margin-right: 8px;\" onclick=\"installActivity();\">&lt;i class=\"bi bi-download\">&lt;\/i> \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0411\u041f&lt;\/button>                 &lt;button class=\"btn btn-primary\" onclick=\"uninstallActivity('getspel');\">&lt;i class=\"bi bi-x-square\">&lt;\/i> \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435&lt;\/button>             &lt;\/div>         &lt;\/div>         &lt;script type=\"text\/javascript\">             function installActivity()             {                 var params = { 'CODE': 'getspel', \/\/\u043a\u043e\u0434, \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u043f\u043e\u0440\u0442\u0430\u043b\u0430 'HANDLER': 'https:\/\/example.com\/example.app\/handler.php',\/\/\u0432\u0430\u0448 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a 'AUTH_USER_ID': 1, 'USE_SUBSCRIPTION': '', 'NAME': '\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0421\u041f',                     'USE_PLACEMENT': 'Y',                     'PLACEMENT_HANDLER': 'https:\/\/example.com\/example.app\/setting.php',\/\/\u0432\u0430\u0448 \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a 'DESCRIPTION': '\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0438\u043f \u0421\u041f, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0438 \u0441\u0442\u0430\u0434\u0438\u044e, \u0432\u044b\u0434\u0430\u0451\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 id \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0441\u0442\u0430\u0434\u0438\u0438', 'PROPERTIES': { \/\/\u0437\u0434\u0435\u0441\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 setting, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0440\u0443\u043a\u0430\u043c\u0438 'typeSP': { 'Name': '\u0422\u0438\u043f \u0421\u041f', 'Type': 'string', 'Required': 'Y', 'Multiple': 'N' }, 'categoryID': {  'Name': '\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f', 'Type': 'string', 'Required': 'Y', 'Multiple': 'N' }, 'statusID': {  'Name': '\u0421\u0442\u0430\u0442\u0443\u0441', 'Type': 'string', 'Required': 'Y', 'Multiple': 'N' },                         'sTypeSP': { 'Name': '\u0422\u0438\u043f \u0421\u041f', 'Type': 'string', 'Required': 'Y', 'Multiple': 'N' }, 'sCategoryID': {  'Name': '\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f', 'Type': 'string', 'Required': 'Y', 'Multiple': 'N' }, 'sStatusID': {  'Name': '\u0421\u0442\u0430\u0442\u0443\u0441', 'Type': 'string', 'Required': 'Y', 'Multiple': 'N' } },                     'RETURN_PROPERTIES': { \/\/\u0432\u0435\u0440\u043d\u0451\u043c \u043c\u0430\u0441\u0441\u0438\u0432 ID \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0421\u041f                         'outputString': {                             'Name': {                                 'ru': 'IDs',                                 'en': 'IDs'                             },                             'Type': 'string',                             'Multiple': 'Y',                             'Default': null                         }                     }     };                  BX24.callMethod(                     'bizproc.activity.add',                     params,                     function(result)                     {                         if(result.error())                             alert(\"Error: \" + result.error());                         else                             alert(\"\u0423\u0441\u043f\u0435\u0448\u043d\u043e: \" + result.data());                     }                 );             }              function uninstallActivity(code)             {                 let params = {                     'CODE': code                 };                  BX24.callMethod(                     'bizproc.activity.delete',                     params,                     function(result)                     {                         if(result.error())                             alert('Error: ' + result.error());                         else                             alert(\"\u0423\u0441\u043f\u0435\u0448\u043d\u043e: \" + result.data());                     }                 );             }         &lt;\/script>     &lt;\/body> &lt;\/html><\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>2. <strong>handler.php<\/strong> \u2013 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442;<\/p>\n<details class=\"spoiler\">\n<summary>handler.php<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"php\">&lt;?php $protocol = $_SERVER['SERVER_PORT'] == '443' ? 'https' : 'http'; $host = explode(':', $_SERVER['HTTP_HOST']); $host = $host[0];  define('BP_APP_HANDLER', $protocol.':\/\/'.$host.$_SERVER['REQUEST_URI']);  if (!empty($_REQUEST['workflow_id']))\/\/\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 - \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043f\u043e\u0434 \u0441\u0435\u0431\u044f {     if (!empty($_REQUEST['properties']['typeSP'])){          $par = array( \/\/\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0421\u041f \u043d\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u0435             'entityTypeId' => $_REQUEST['properties']['typeSP'],              'select'       => ['id'],             'order'        => null,              'filter'       => ['categoryId' => $_REQUEST['properties']['categoryID'], 'stageId' => $_REQUEST['properties']['statusID']],         );          \/\/\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u0435\u0431\u0445\u0443\u043a \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u043d\u0430 CRM, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043e\u0442\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f \u043d\u0430 Crest - \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434 \u0437\u0430\u0434\u0430\u0447\u0443         $result = callB24Method('https:\/\/example.bitrix24.ru\/rest\/1\/59i35rrrzqg0np\/','crm.item.list', $par); \/\/\u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c ID's \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0421\u041f          $arr = [];         foreach($result['result']['items'] as $item){ \/\/\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432             $arr[] = $item['id'];         }          \/\/\u0431\u0435\u0440\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u0437 \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0435\u0433\u043e \u0411\u041f, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0432 \u0411\u041f         $params = array(             \"auth\" => $_REQUEST['auth'][\"access_token\"],             \"event_token\" => $_REQUEST[\"event_token\"],             \"log_message\" => \"\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b\",             \"return_values\" => array(                 \"outputString\" => $arr,             )         );         $r = callB24Method('https:\/\/example.bitrix24.ru\/rest\/','bizproc.event.send', $params);     }  }   function callB24Method($bitrix, $method, $params){ \/\/\u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431\u0445\u0443\u043a     $c = curl_init($bitrix . $method . '.json');      curl_setopt($c, CURLOPT_RETURNTRANSFER, true);     curl_setopt($c, CURLOPT_POST, true);     curl_setopt($c, CURLOPT_POSTFIELDS, http_build_query($params));      $response = curl_exec($c);     $response = json_decode($response, true);      return $response; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>3. <strong>setting.php<\/strong> \u2013 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u0444\u0440\u0435\u0439\u043c\u0430 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438, \u043d\u0430\u0448 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440.<\/p>\n<details class=\"spoiler\">\n<summary>setting.php<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"php\">&lt;?php header('Content-Type: text\/html; charset=UTF-8');  $protocol = $_SERVER['SERVER_PORT'] == '443' ? 'https' : 'http'; $host = explode(':', $_SERVER['HTTP_HOST']); $host = $host[0];  define('BP_APP_HANDLER', $protocol.':\/\/'.$host.explode('?', $_SERVER['REQUEST_URI'])[0]);  $obj = json_decode($_POST['PLACEMENT_OPTIONS']); \/\/\u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043e\u0442\u0440\u0438\u0441\u0443\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b $sp       = $obj->current_values->sTypeSP; $category = $obj->current_values->sCategoryID; $status   = $obj->current_values->sStatusID; ?> &lt;!DOCTYPE html> &lt;html lang=\"en\" dir=\"ltr\">     &lt;head>         &lt;meta charset=\"utf-8\">         &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue\/dist\/vue.js\">&lt;\/script>         &lt;script src=\"https:\/\/unpkg.com\/axios\/dist\/axios.min.js\">&lt;\/script>         &lt;script src=\"\/\/api.bitrix24.com\/api\/v1\/\">&lt;\/script>         &lt;link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.2\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-EVSTQN3\/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC\" crossorigin=\"anonymous\">         &lt;style>             .select {                 min-width: 25%;                 margin-bottom: 20px;                 padding-bottom: 3px;                 padding-top: 3px;             }             .label {                 font-size: 0.9rem;                 margin-top: 1rem;                 margin-left: 20rem;             }         &lt;\/style>     &lt;\/head>     &lt;body>         &lt;!-- \u0432\u0451\u0440\u0441\u0442\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u043e\u0439, \u0433\u043b\u0430\u0432\u043d\u043e\u0435 - \u0432\u044b\u0437\u0432\u0430\u0442\u044c BX24.placement.call \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b -->         &lt;div id=\"app\" style=\"background-color:#f5f9f9; height: 250px;width: 853px;\" >             &lt;div style=\"width: 635px;padding-right: 42px; float: right; display: inline-block;margin-top: 15px;\">                 &lt;div>                     &lt;select class=\"form-select select\" v-model=\"typeSearch\">                         &lt;option value=\"\" disabled selected>&lt;?=$sp ?>&lt;\/option>                         &lt;option v-for=\"type in types\" v-bind:value=\"{ id: type.entityTypeId, name: type.title }\"> {{ type.title }}&lt;\/option>                     &lt;\/select>                 &lt;\/div>                 &lt;div>                     &lt;select class=\"form-select select\" v-model=\"categorySearch\">                         &lt;option value=\"\" disabled selected>&lt;?=$category ?>&lt;\/option>                         &lt;option v-for=\"category in categories\" v-bind:value=\"{ id: category.id, name: category.name }\"> {{ category.name }}&lt;\/option>                     &lt;\/select>                 &lt;\/div>                 &lt;div >                     &lt;select class=\"form-select select\" v-model=\"statusSearch\">                         &lt;option value=\"\" disabled selected>&lt;?=$status ?>&lt;\/option>                         &lt;option v-for=\"status in statuses\" v-bind:value=\"{ id: status.STATUS_ID, name: status.NAME }\"> {{ status.NAME }}&lt;\/option>                     &lt;\/select>                 &lt;\/div>             &lt;\/div>             &lt;div style=\"float: left; display: inline-block;margin-top: 15px;margin-left: 5rem;\">                 &lt;div>                      &lt;p style=\"font-size: 0.9rem;text-align: end;padding-top: 4px;\">\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0421\u041f:&lt;\/p>                 &lt;\/div>                 &lt;div>                     &lt;p style=\"font-size: 0.9rem;text-align: end;margin-top: 29px;\">\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u043e\u0440\u043e\u043d\u043a\u0443:&lt;\/p>                 &lt;\/div>                 &lt;div>                     &lt;p style=\"font-size: 0.9rem;text-align: end;margin-top: 29px;\">\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0442\u0430\u0442\u0443\u0441:&lt;\/p>                 &lt;\/div>             &lt;\/div>         &lt;\/div>         &lt;script>             let app = new Vue({                 el: '#app',                 data: {                     types: [],                     categories: [],                     statuses: [],                     typeSearch: '',                     categorySearch: '',                     statusSearch: ''                 },                 created: function() { \/\/\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0421\u041f \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0444\u0440\u0435\u0439\u043c\u0430                     BX24.resizeWindow(853, 250);                     BX24.callMethod(                         'crm.type.list',                         '',                         function(result)                         {                             if(result.error())                                 alert(\"Error: \" + result.error());                             else                                  app.types = result.data().types;                         }                     );                 },                 watch: {                     typeSearch: function() { \/\/\u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0421\u041f - \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0435\u0433\u043e \u0432\u043e\u0440\u043e\u043d\u043a\u0438                         BX24.callMethod(                             'crm.category.list',                             {\"entityTypeId\": app.typeSearch.id},                             function(result)                             {                                 if(result.error())                                     alert(\"Error\");                                 else                                  app.categories = result.data().categories;                             }                         );                     },                     categorySearch: function() {\/\/\u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0432\u043e\u0440\u043e\u043d\u043a\u0443 - \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u044b                         BX24.callMethod(                             'crm.status.list',                             {'filter': { \"ENTITY_ID\": 'DYNAMIC_' + app.typeSearch.id + '_STAGE_' + app.categorySearch.id}},                             function(result)                             {                                 if(result.error())                                     alert(\"Error\");                                 else                                  app.statuses = result.data();                             }                         );                     },                     statusSearch: function() {                         BX24.placement.call( \/\/\u043e\u0431\u043d\u043e\u0432\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430                             'setPropertyValue',                             {'typeSP': app.typeSearch.id, 'categoryID': app.categorySearch.id, 'statusID': app.statusSearch.id, 'sTypeSP': app.typeSearch.name, 'sCategoryID': app.categorySearch.name, 'sStatusID': app.statusSearch.name}                         )                     }                 }             })         &lt;\/script>     &lt;\/body> &lt;\/html><\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/h2>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0434\u0435\u043b\u043a\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0421\u041f, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u043d\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0434\u0438\u0438, \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441 ID \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c. \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e, \u0421\u041f \u0440\u0430\u0437\u043d\u044b\u0435, \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0411\u041f \u0440\u0430\u0437\u043d\u044b\u0435 &#8212; \u0440\u0435\u0448\u0438\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0441 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433\u043e\u043c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445.<\/p>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u043a\u043e\u0434, \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0435 &#8212; \u043c\u044b \u043e\u0441\u0432\u0435\u0442\u0438\u043c \u0432\u0441\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 (\u0441\u0441\u044b\u043b\u043a\u0438 \u0432 <strong>index.php<\/strong> \u0438 <strong>handler.php<\/strong>)<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c <strong>index.php<\/strong>, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u041124. \u0424\u0430\u0439\u043b \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 php \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, html \u0432\u0451\u0440\u0441\u0442\u043a\u0443 (\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a-\u043a\u043d\u043e\u043f\u043a\u0438) \u0438 js \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\/\u0443\u0434\u0430\u043b\u0438\u0442\u044c. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0434\u043b\u044f <strong>bizproc.activity.add<\/strong>, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 <strong>USE_PLACEMENT:<\/strong><\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"javascript\">var params = { 'CODE': 'getspel', \/\/\u043a\u043e\u0434, \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u043f\u043e\u0440\u0442\u0430\u043b\u0430 'HANDLER': 'https:\/\/\/example.com\/example.app\/handler.php',\/\/\u0432\u0430\u0448 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a 'AUTH_USER_ID': 1, 'USE_SUBSCRIPTION': '', 'NAME': '\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0421\u041f',             'USE_PLACEMENT': 'Y',             'PLACEMENT_HANDLER': 'example.com\/example.app\/setting.php',\/\/\u0432\u0430\u0448 \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a 'DESCRIPTION': '\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0438\u043f \u0421\u041f, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0438 \u0441\u0442\u0430\u0434\u0438\u044e, \u0432\u044b\u0434\u0430\u0451\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 id \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0441\u0442\u0430\u0434\u0438\u0438', 'PROPERTIES': { \/\/\u0437\u0434\u0435\u0441\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 setting, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0440\u0443\u043a\u0430\u043c\u0438     'typeSP': {             'Name': '\u0422\u0438\u043f \u0421\u041f',     'Type': 'string',     'Required': 'Y',     'Multiple': 'N'             },                   .... },             'RETURN_PROPERTIES': { \/\/\u0432\u0435\u0440\u043d\u0451\u043c \u043c\u0430\u0441\u0441\u0438\u0432 ID \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0421\u041f                   'outputString': {                       'Name': {                           'ru': 'IDs',                           'en': 'IDs'                       },                       'Type': 'string',                       'Multiple': 'Y',                       'Default': null                     }             } };<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0440\u0442\u0430\u043b, \u0443\u043a\u0430\u0436\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 <strong>index.php<\/strong>, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u0440\u0430\u0432\u0430:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/da9\/034\/1fb\/da90341fbe9967e688fb563b365ab955.png\" alt=\"\u041d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f CRM \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0421\u043c\u0430\u0440\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c, \u0411\u041f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0438 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438.\" title=\"\u041d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f CRM \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0421\u043c\u0430\u0440\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c, \u0411\u041f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0438 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438.\" width=\"1458\" height=\"795\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/da9\/034\/1fb\/da90341fbe9967e688fb563b365ab955.png\"\/><figcaption>\u041d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f CRM \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0421\u043c\u0430\u0440\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c, \u0411\u041f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0438 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438.<\/figcaption><\/figure>\n<ol start=\"3\">\n<li>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c (\u0432 \u0444\u0440\u0435\u0439\u043c\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0442\u0430\u043a \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0439\u0442\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0439\u0442\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0438\u0437 \u043f\u043e\u0434 \u0430\u0434\u043c\u0438\u043d\u0430), \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u0435\u0433\u043e \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5f6\/d82\/7a6\/5f6d827a6bf9c5012b5ad5ca03e19ddc.png\" alt=\"\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e!\" title=\"\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e!\" width=\"1763\" height=\"441\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5f6\/d82\/7a6\/5f6d827a6bf9c5012b5ad5ca03e19ddc.png\"\/><figcaption>\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e!<\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/08e\/887\/ae9\/08e887ae960e7af1bf4cdef910529e20.png\" alt=\"\u0410\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, \u043d\u043e \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430\" title=\"\u0410\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, \u043d\u043e \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430\" width=\"1793\" height=\"568\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/08e\/887\/ae9\/08e887ae960e7af1bf4cdef910529e20.png\"\/><figcaption>\u0410\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, \u043d\u043e \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430<\/figcaption><\/figure>\n<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 &#8212; \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u0445 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"php\">&lt;?php \/\/\u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043e\u0442\u0440\u0438\u0441\u0443\u0435\u043c \u0432 \u0432\u0451\u0440\u0441\u0442\u043a\u0435 $obj = json_decode($_POST['PLACEMENT_OPTIONS']);  $sp       = $obj->current_values->sTypeSP; $category = $obj->current_values->sCategoryID; $status   = $obj->current_values->sStatusID;<\/code><\/pre>\n<p><em>&#8230;\u0417\u0434\u0435\u0441\u044c \u0432\u0451\u0440\u0441\u0442\u043a\u0430&#8230;<\/em><\/p>\n<pre><code class=\"javascript\">BX24.placement.call( \/\/\u043e\u0431\u043d\u043e\u0432\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0439                             'setPropertyValue',                             {'typeSP': app.typeSearch.id, 'categoryID': app.categorySearch.id, 'statusID': app.statusSearch.id, 'sTypeSP': app.typeSearch.name, 'sCategoryID': app.categorySearch.name, 'sStatusID': app.statusSearch.name}                         )<\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cfe\/2c7\/c42\/cfe2c7c42b9404744edb8641248b8ee5.png\" alt=\"\u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c.  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u043b\u0430\u0434\u0451\u043c \u0432 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438\" title=\"\u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c.  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u043b\u0430\u0434\u0451\u043c \u0432 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438\" width=\"1818\" height=\"638\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cfe\/2c7\/c42\/cfe2c7c42b9404744edb8641248b8ee5.png\"\/><figcaption>\u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c.  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u043b\u0430\u0434\u0451\u043c \u0432 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438<\/figcaption><\/figure>\n<\/li>\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 <strong>handler.php<\/strong>. \u0417\u0434\u0435\u0441\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u043b\u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0435\u0431\u0445\u0443\u043a \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u043d\u0430 CRM:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"php\">&lt;?php \/\/\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 - \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043f\u043e\u0434 \u0441\u0435\u0431\u044f if (!empty($_REQUEST['workflow_id'])) {   \/\/\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0421\u041f \u043d\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u0435   $par = array(       'entityTypeId' => $_REQUEST['properties']['typeSP'],        'select'       => ['id'],       'order'        => null,        'filter'       => ['categoryId' => $_REQUEST['properties']['categoryID'],'stageId' => $_REQUEST['properties']['statusID']],   );    \/\/\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u0435\u0431\u0445\u0443\u043a \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u043d\u0430 CRM, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043e\u0442\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f \u043d\u0430 Crest -    \/\/\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434 \u0437\u0430\u0434\u0430\u0447\u0443   $result = callB24Method('https:\/\/example.bitrix24.ru\/rest\/1\/59itd45y6rzqg0np\/',                                               'crm.item.list', $par); \/\/\u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c ID's \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0421\u041f    $arr = [];   foreach($result['result']['items'] as $item){ \/\/\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432           $arr[] = $item['id'];   }    \/\/\u0431\u0435\u0440\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u0437 \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0435\u0433\u043e \u0411\u041f, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0432 \u0411\u041f   $params = array(       \"auth\" => $_REQUEST['auth'][\"access_token\"],       \"event_token\" => $_REQUEST[\"event_token\"],       \"log_message\" => \"\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b\",       \"return_values\" => array(\"outputString\" => $arr)   );   $r = callB24Method('https:\/\/example.bitrix24.ru\/rest\/','bizproc.event.send',$params); }<\/code><\/pre>\n<ol start=\"7\">\n<li>\n<p>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1af\/211\/7fe\/1af2117fe3053ffa02f6d8a4f0ba02cc.png\" width=\"1731\" height=\"475\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1af\/211\/7fe\/1af2117fe3053ffa02f6d8a4f0ba02cc.png\"\/><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b0f\/b3c\/8b4\/b0fb3c8b434f077c8e79977e45215c9e.png\" width=\"1674\" height=\"314\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b0f\/b3c\/8b4\/b0fb3c8b434f077c8e79977e45215c9e.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u043c \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u0411\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u044b \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0438 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/694874\/\"> https:\/\/habr.com\/ru\/post\/694874\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0438\u043b\u0438 activity \u0432 \u0411\u0438\u0442\u0440\u0438\u043a\u044124 \u2013 \u044d\u0442\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435.  <\/p>\n<p>\u0412 REST API \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 \u201cbizproc.activity.add\u201d, \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0438 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u0434\u043b\u044f \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e\u0440\u0442\u0430\u043b\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u00ab\u0444\u0440\u043e\u043d\u0442\u00bb \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0432\u0430\u0448\u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 (\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443, \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435) \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0438 \u0441 \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0438\u0437 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432, \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0438\u0441\u043a\u0430 id \u0438\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u043b\u0435).<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043c\u0430\u0440\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c REST, php, js. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c vue.js, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0433\u043b\u0430\u0432\u043d\u043e\u0435 &#8212; \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 ajax \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0418, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043f\u043e https.<\/p>\n<hr\/>\n<h2>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430<\/h2>\n<p>\u041d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 3 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<p>1. <strong>index.php<\/strong> \u2013 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438;<\/p>\n<details class=\"spoiler\">\n<summary>index.php<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"php\">&lt;?php header('Content-Type: text\/html; charset=UTF-8');  $protocol = $_SERVER['SERVER_PORT'] == '443' ? 'https' : 'http'; $host = explode(':', $_SERVER['HTTP_HOST']); $host = $host[0];  define('BP_APP_HANDLER', $protocol.':\/\/'.$host.explode('?', $_SERVER['REQUEST_URI'])[0]); ?> &lt;!DOCTYPE html> &lt;html lang=\"en\">     &lt;head>         &lt;meta charset=\"UTF-8\">         &lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">         &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">         &lt;script src=\"\/\/api.bitrix24.com\/api\/v1\/\">&lt;\/script>         &lt;link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.2\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-EVSTQN3\/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC\" crossorigin=\"anonymous\">     &lt;\/head>     &lt;body>         &lt;h1 style=\"text-align: center;margin-bottom: 2rem;width: 100%\">\u0410\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u043e\u043f\u0442\u0438\u043c&lt;\/h1>         &lt;div style=\"margin-left: 30px;max-width: 26rem;\">             &lt;div class=\"item\">                 &lt;h3 style=\"text-align: center;\">\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0421\u041f\"&lt;\/h3>                 &lt;button class=\"btn btn-primary\" style=\"margin-right: 8px;\" onclick=\"installActivity();\">&lt;i class=\"bi bi-download\">&lt;\/i> \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0411\u041f&lt;\/button>                 &lt;button class=\"btn btn-primary\" onclick=\"uninstallActivity('getspel');\">&lt;i class=\"bi bi-x-square\">&lt;\/i> \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435&lt;\/button>             &lt;\/div>         &lt;\/div>         &lt;script type=\"text\/javascript\">             function installActivity()             {                 var params = { 'CODE': 'getspel', \/\/\u043a\u043e\u0434, \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u043f\u043e\u0440\u0442\u0430\u043b\u0430 'HANDLER': 'https:\/\/example.com\/example.app\/handler.php',\/\/\u0432\u0430\u0448 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a 'AUTH_USER_ID': 1, 'USE_SUBSCRIPTION': '', 'NAME': '\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0421\u041f',                     'USE_PLACEMENT': 'Y',                     'PLACEMENT_HANDLER': 'https:\/\/example.com\/example.app\/setting.php',\/\/\u0432\u0430\u0448 \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a 'DESCRIPTION': '\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0438\u043f \u0421\u041f, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0438 \u0441\u0442\u0430\u0434\u0438\u044e, \u0432\u044b\u0434\u0430\u0451\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 id \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0441\u0442\u0430\u0434\u0438\u0438', 'PROPERTIES': { \/\/\u0437\u0434\u0435\u0441\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 setting, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0440\u0443\u043a\u0430\u043c\u0438 'typeSP': { 'Name': '\u0422\u0438\u043f \u0421\u041f', 'Type': 'string', 'Required': 'Y', 'Multiple': 'N' }, 'categoryID': {  'Name': '\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f', 'Type': 'string', 'Required': 'Y', 'Multiple': 'N' }, 'statusID': {  'Name': '\u0421\u0442\u0430\u0442\u0443\u0441', 'Type': 'string', 'Required': 'Y', 'Multiple': 'N' },                         'sTypeSP': { 'Name': '\u0422\u0438\u043f \u0421\u041f', 'Type': 'string', 'Required': 'Y', 'Multiple': 'N' }, 'sCategoryID': {  'Name': '\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f', 'Type': 'string', 'Required': 'Y', 'Multiple': 'N' }, 'sStatusID': {  'Name': '\u0421\u0442\u0430\u0442\u0443\u0441', 'Type': 'string', 'Required': 'Y', 'Multiple': 'N' } },                     'RETURN_PROPERTIES': { \/\/\u0432\u0435\u0440\u043d\u0451\u043c \u043c\u0430\u0441\u0441\u0438\u0432 ID \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0421\u041f                         'outputString': {                             'Name': {                                 'ru': 'IDs',                                 'en': 'IDs'                             },                             'Type': 'string',                             'Multiple': 'Y',                             'Default': null                         }                     }     };                  BX24.callMethod(                     'bizproc.activity.add',                     params,                     function(result)                     {                         if(result.error())                             alert(\"Error: \" + result.error());                         else                             alert(\"\u0423\u0441\u043f\u0435\u0448\u043d\u043e: \" + result.data());                     }                 );             }              function uninstallActivity(code)             {                 let params = {                     'CODE': code                 };                  BX24.callMethod(                     'bizproc.activity.delete',                     params,                     function(result)                     {                         if(result.error())                             alert('Error: ' + result.error());                         else                             alert(\"\u0423\u0441\u043f\u0435\u0448\u043d\u043e: \" + result.data());                     }                 );             }         &lt;\/script>     &lt;\/body> &lt;\/html><\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>2. <strong>handler.php<\/strong> \u2013 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442;<\/p>\n<details class=\"spoiler\">\n<summary>handler.php<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"php\">&lt;?php $protocol = $_SERVER['SERVER_PORT'] == '443' ? 'https' : 'http'; $host = explode(':', $_SERVER['HTTP_HOST']); $host = $host[0];  define('BP_APP_HANDLER', $protocol.':\/\/'.$host.$_SERVER['REQUEST_URI']);  if (!empty($_REQUEST['workflow_id']))\/\/\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 - \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043f\u043e\u0434 \u0441\u0435\u0431\u044f {     if (!empty($_REQUEST['properties']['typeSP'])){          $par = array( \/\/\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0421\u041f \u043d\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u0435             'entityTypeId' => $_REQUEST['properties']['typeSP'],              'select'       => ['id'],             'order'        => null,              'filter'       => ['categoryId' => $_REQUEST['properties']['categoryID'], 'stageId' => $_REQUEST['properties']['statusID']],         );          \/\/\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u0435\u0431\u0445\u0443\u043a \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u043d\u0430 CRM, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043e\u0442\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f \u043d\u0430 Crest - \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434 \u0437\u0430\u0434\u0430\u0447\u0443         $result = callB24Method('https:\/\/example.bitrix24.ru\/rest\/1\/59i35rrrzqg0np\/','crm.item.list', $par); \/\/\u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c ID's \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0421\u041f          $arr = [];         foreach($result['result']['items'] as $item){ \/\/\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432             $arr[] = $item['id'];         }          \/\/\u0431\u0435\u0440\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u0437 \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0435\u0433\u043e \u0411\u041f, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0432 \u0411\u041f         $params = array(             \"auth\" => $_REQUEST['auth'][\"access_token\"],             \"event_token\" => $_REQUEST[\"event_token\"],             \"log_message\" => \"\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b\",             \"return_values\" => array(                 \"outputString\" => $arr,             )         );         $r = callB24Method('https:\/\/example.bitrix24.ru\/rest\/','bizproc.event.send', $params);     }  }   function callB24Method($bitrix, $method, $params){ \/\/\u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431\u0445\u0443\u043a     $c = curl_init($bitrix . $method . '.json');      curl_setopt($c, CURLOPT_RETURNTRANSFER, true);     curl_setopt($c, CURLOPT_POST, true);     curl_setopt($c, CURLOPT_POSTFIELDS, http_build_query($params));      $response = curl_exec($c);     $response = json_decode($response, true);      return $response; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>3. <strong>setting.php<\/strong> \u2013 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u0444\u0440\u0435\u0439\u043c\u0430 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438, \u043d\u0430\u0448 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440.<\/p>\n<details class=\"spoiler\">\n<summary>setting.php<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"php\">&lt;?php header('Content-Type: text\/html; charset=UTF-8');  $protocol = $_SERVER['SERVER_PORT'] == '443' ? 'https' : 'http'; $host = explode(':', $_SERVER['HTTP_HOST']); $host = $host[0];  define('BP_APP_HANDLER', $protocol.':\/\/'.$host.explode('?', $_SERVER['REQUEST_URI'])[0]);  $obj = json_decode($_POST['PLACEMENT_OPTIONS']); \/\/\u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043e\u0442\u0440\u0438\u0441\u0443\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b $sp       = $obj->current_values->sTypeSP; $category = $obj->current_values->sCategoryID; $status   = $obj->current_values->sStatusID; ?> &lt;!DOCTYPE html> &lt;html lang=\"en\" dir=\"ltr\">     &lt;head>         &lt;meta charset=\"utf-8\">         &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue\/dist\/vue.js\">&lt;\/script>         &lt;script src=\"https:\/\/unpkg.com\/axios\/dist\/axios.min.js\">&lt;\/script>         &lt;script src=\"\/\/api.bitrix24.com\/api\/v1\/\">&lt;\/script>         &lt;link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.2\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-EVSTQN3\/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC\" crossorigin=\"anonymous\">         &lt;style>             .select {                 min-width: 25%;                 margin-bottom: 20px;                 padding-bottom: 3px;                 padding-top: 3px;             }             .label {                 font-size: 0.9rem;                 margin-top: 1rem;                 margin-left: 20rem;             }         &lt;\/style>     &lt;\/head>     &lt;body>         &lt;!-- \u0432\u0451\u0440\u0441\u0442\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u043e\u0439, \u0433\u043b\u0430\u0432\u043d\u043e\u0435 - \u0432\u044b\u0437\u0432\u0430\u0442\u044c BX24.placement.call \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b -->         &lt;div id=\"app\" style=\"background-color:#f5f9f9; height: 250px;width: 853px;\" >             &lt;div style=\"width: 635px;padding-right: 42px; float: right; display: inline-block;margin-top: 15px;\">                 &lt;div>                     &lt;select class=\"form-select select\" v-model=\"typeSearch\">                         &lt;option value=\"\" disabled selected>&lt;?=$sp ?>&lt;\/option>                         &lt;option v-for=\"type in types\" v-bind:value=\"{ id: type.entityTypeId, name: type.title }\"> {{ type.title }}&lt;\/option>                     &lt;\/select>                 &lt;\/div>                 &lt;div>                     &lt;select class=\"form-select select\" v-model=\"categorySearch\">                         &lt;option value=\"\" disabled selected>&lt;?=$category ?>&lt;\/option>                         &lt;option v-for=\"category in categories\" v-bind:value=\"{ id: category.id, name: category.name }\"> {{ category.name }}&lt;\/option>                     &lt;\/select>                 &lt;\/div>                 &lt;div >                     &lt;select class=\"form-select select\" v-model=\"statusSearch\">                         &lt;option value=\"\" disabled selected>&lt;?=$status ?>&lt;\/option>                         &lt;option<\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-340101","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=340101"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340101\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=340101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=340101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=340101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}