hmLoadTopic({
hmKeywords:"",
hmTitle:"Nastavenie ESET PROTECT On-Prem REST API",
hmDescription:"Nastavte ESET PROTECT On-Prem REST API podľa nasledujúcich krokov:",
hmPrevLink:"how_api_works.html",
hmNextLink:"api.html",
hmParentLink:"rest_api.html",
hmBreadCrumbs:"<a href=\"rest_api.html\">ESET PROTECT On-Prem REST API<\/a>",
hmTitlePath:"ESET PROTECT On-Prem REST API > Nastavenie ESET PROTECT On-Prem REST API",
hmHeader:"<h1 class=\"p_Heading1\"><span class=\"f_Heading1\">Nastavenie ESET PROTECT On-Prem REST API<\/span><\/h1>\n\r",
hmBody:"<p class=\"p_Normal\">Nastavte ESET PROTECT On-Prem REST API podľa nasledujúcich krokov:<\/p>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 20px; margin-left: 0;\"><span class=\"f_Normal\" style=\"display:inline-block;width:20px;margin-left:-20px\">1.<\/span>V časti <span class=\"f_UI\">Viac<\/span> &gt; <a href=\"admin_server_settings.html#api\" class=\"topiclink\">Nastavenia<\/a> zapnite REST API.<\/p>\n\r<div style=\"text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 10px 0;\"><table class=\"Table_important\" >\n\r<tr class=\"Table_important\">\n\r<td class=\"Table_important\" style=\"width:4px; background-color:#E9A514;\"><br \/>\n\r<\/td>\n\r<td class=\"Table_important\" style=\"width:20px;\"><p class=\"p_Normal\"><img alt=\"Dôležité\" title=\"Dôležité\" width=\"20\" height=\"20\" style=\"margin:2px 0 0 0;width:20px;height:20px;border:none\" src=\".\/images\/important.svg\"\/><\/p>\n\r<\/td>\n\r<td class=\"Table_important\"><p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 13px; margin-left: 0;\"><span class=\"f_Normal\" style=\"font-family: Arial,\'Lucida Sans Unicode\',\'Lucida Grande\',\'Lucida Sans\';display:inline-block;width:13px;margin-left:-13px\">&#8226;<\/span>Uistite sa, že sú v lokálnom firewalle otvorené porty API.<\/p>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 13px; margin-left: 0;\"><span class=\"f_Normal\" style=\"font-family: Arial,\'Lucida Sans Unicode\',\'Lucida Grande\',\'Lucida Sans\';display:inline-block;width:13px;margin-left:-13px\">&#8226;<\/span>Aby bolo možné používať REST API, partnerský certifikát pre ESET PROTECT Server (bez ohľadu na to, či sa používa ako certifikát servera REST alebo nie) musí obsahovať <span class=\"f_CodeHighlighted\">localhost<\/span> v poli <span class=\"f_UI\">Spoločný názov<\/span>\/<span class=\"f_UI\">Hostiteľ<\/span>. Ak partnerský certifikát (servera) nespĺňa túto požiadavku, <a href=\"certificates_certificate_era.html\" class=\"topiclink\">vytvorte nový certifikát<\/a> a <a href=\"set_new_era_server_certificate.html\" class=\"topiclink\">zmeňte certifikát servera<\/a>.<\/p><\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 20px; margin-left: 0;\"><span class=\"f_Normal\" style=\"display:inline-block;width:20px;margin-left:-20px\">2.<\/span>Priraďte používateľom API <a href=\"admin_ar_permissions_list.html\" class=\"topiclink\">súbor povolení<\/a> <span class=\"f_UI\">API<\/span>.<\/p>\n\r<div style=\"text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 10px 0;\"><table class=\"Table_important\" >\n\r<tr class=\"Table_important\">\n\r<td class=\"Table_important\" style=\"width:4px; background-color:#E9A514;\"><br \/>\n\r<\/td>\n\r<td class=\"Table_important\" style=\"width:20px;\"><p class=\"p_Normal\"><img alt=\"Dôležité\" title=\"Dôležité\" width=\"20\" height=\"20\" style=\"margin:2px 0 0 0;width:20px;height:20px;border:none\" src=\".\/images\/important.svg\"\/><\/p>\n\r<\/td>\n\r<td class=\"Table_important\"><p class=\"p_Normal\">Účet správcu nemôže používať API.<\/p>\n\r<\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 20px; margin-left: 0;\"><span class=\"f_Normal\" style=\"display:inline-block;width:20px;margin-left:-20px\">3.<\/span>Na automatizáciu interakcií s ESET PROTECT On-Prem API môžete použiť <a href=\"admin_server_settings.html#api\" class=\"topiclink\">integrovaný nástroj Swagger UI<\/a> (k dispozícii od verzie ESET PROTECT On-Prem 13.1).<\/p>\n\r<p class=\"p_Normal\" style=\"text-indent: -42px; margin: 0 0 10px 55px;\"><img id=\"toggle0186a1_ICON\" class=\"dropdown-toggle-icon\" alt=\"arrow_down_business\" width=\"21\" height=\"21\" style=\"margin:0;width:21px;height:21px;border:none\" src=\".\/images\/arrow_down_business.svg\"\/> <a id=\"toggle0186a1_LINK\" class=\"dropdown-toggle\" href=\"javascript:void(0)\" data-type=\"dropdown\" data-state=\"0\" data-icon=\"toggle0186a1_ICON\" data-src0=\".\/images\/arrow_down_business.svg\" data-src1=\".\/images\/arrow_up_business.svg\">Čo je Swagger UI?<\/a><\/p>\n\r<div id=\"toggle0186a1\" class=\"dropdown-toggle-body\" style=\"text-align: left; padding: 0 0 0 0; margin: 0 0 10px 38px;display:none\"><table style=\"border:none; border-spacing:0;\" role=\"presentation\">\n\r<tr>\n\r<td style=\"vertical-align:top; padding:0; border:none\"><p class=\"p_Normal\"><a href=\"https:\/\/swagger.io\/\" target=\"_blank\" onclick=\"return HMTrackTopiclink(this);\" class=\"weblink\">Swagger UI<\/a> je aplikačný rámec s otvoreným zdrojovým kódom, ktorý pomáha vývojárom navrhovať, vytvárať, dokumentovať a využívať webové služby RESTful. Pomocou nástroja Swagger UI môžete otestovať volania API prostredníctvom webovej stránky:<\/p>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 20px; margin-left: 0;\"><span class=\"f_Normal\" style=\"display:inline-block;width:20px;margin-left:-20px\">1.<\/span>V <a href=\"admin_server_settings.html#api\" class=\"topiclink\">nastaveniach<\/a> ESET PROTECT Servera zapnite Swagger UI.<\/p>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 20px; margin-left: 0;\"><span class=\"f_Normal\" style=\"display:inline-block;width:20px;margin-left:-20px\">2.<\/span>Aktivovaný integrovaný nástroj Swagger UI je dostupný na <a href=\"https:\/\/localhost:9443\/swagger\" target=\"_blank\" onclick=\"return HMTrackTopiclink(this);\" class=\"weblink\">https:\/\/localhost:9443\/swagger<\/a>. V prípade potreby nahraďte <span class=\"f_CodeHighlighted\">localhost<\/span> názvom servera alebo IP adresou.<\/p>\n\r<p class=\"p_Normal\">Swagger UI poskytuje <a href=\"api.html\" class=\"topiclink\">kompletné, vopred pripravené volania API<\/a>. Stačí zmeniť hodnoty parametrov vo volaniach.<\/p>\n\r<div style=\"text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 10px 0;\"><table class=\"Table_note\" >\n\r<tr class=\"Table_note\">\n\r<td class=\"Table_note\" style=\"width:4px; background-color:#3DAAE1;\"><br \/>\n\r<\/td>\n\r<td class=\"Table_note\" style=\"width:20px;\"><p class=\"p_Normal\"><img alt=\"Poznámka\" title=\"Poznámka\" width=\"20\" height=\"20\" style=\"margin:2px 0 0 0;width:20px;height:20px;border:none\" src=\".\/images\/note.svg\"\/><\/p>\n\r<\/td>\n\r<td class=\"Table_note\"><p class=\"p_Normal\">Swagger UI je k dispozícii len v angličtine.<\/p>\n\r<\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r<\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r<p class=\"p_Normal\">Alternatívne môžete implementovať volania API do svojej klientskej aplikácie REST (napr. <a href=\"https:\/\/www.postman.com\/\" target=\"_blank\" onclick=\"return HMTrackTopiclink(this);\" class=\"weblink\">Postman<\/a>) alebo použite príkazový riadok (<a href=\"https:\/\/curl.se\/\" target=\"_blank\" onclick=\"return HMTrackTopiclink(this);\" class=\"weblink\">curl<\/a>).<\/p>\n\r<div style=\"text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 10px 0;\"><table class=\"Table_note\" >\n\r<tr class=\"Table_note\">\n\r<td class=\"Table_note\" style=\"width:4px; background-color:#3DAAE1;\"><br \/>\n\r<\/td>\n\r<td class=\"Table_note\" style=\"width:20px;\"><p class=\"p_Normal\"><img alt=\"Poznámka\" title=\"Poznámka\" width=\"20\" height=\"20\" style=\"margin:2px 0 0 0;width:20px;height:20px;border:none\" src=\".\/images\/note.svg\"\/><\/p>\n\r<\/td>\n\r<td class=\"Table_note\"><p class=\"p_Normal\">REST Server beží lokálne na ESET PROTECT Serveri. Nie je možné súčasne používať ESET Connect a ESET PROTECT On-Prem REST API.<\/p>\n\r<\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 20px; margin-left: 0;\"><span class=\"f_Normal\" style=\"display:inline-block;width:20px;margin-left:-20px\">4.<\/span>Odošlite požiadavku <span class=\"f_CodeHighlighted\"><a href=\"https:\/\/help.eset.com\/getHelp?product=protect_admin&amp;version=13.1&amp;lang=sk-SK&amp;topic=api_GetTokens_post\" onclick=\"return HMTrackTopiclink(this);\" class=\"weblink\">GetTokens<\/a><\/span> na prihlásenie na server REST. V nástroji Swagger UI rozbaľte <span class=\"f_CodeHighlighted\">GetTokens<\/span>, kliknite na <span class=\"f_UI\">Try it out<\/span>, zadajte správne údaje do tela požiadavky a kliknite na <span class=\"f_UI\">Execute<\/span>.<\/p>\n\r<div style=\"text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 10px 0;\"><table class=\"Table_small_no_header\" >\n\r<tr class=\"Table_small_no_header\">\n\r<td class=\"Table_small_no_header\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTable\">Metóda<\/span><\/p>\n\r<\/td>\n\r<td class=\"Table_small_no_header\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTable\">POST<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr class=\"Table_small_no_header\">\n\r<td class=\"Table_small_no_header\" style=\"background-color:#F4F5F4;\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTable\">Funkcia<\/span><\/p>\n\r<\/td>\n\r<td class=\"Table_small_no_header\" style=\"background-color:#F4F5F4;\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTable\">getTokens<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr class=\"Table_small_no_header\">\n\r<td class=\"Table_small_no_header\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTable\">URL<\/span><\/p>\n\r<\/td>\n\r<td class=\"Table_small_no_header\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTable\">https:\/\/protect_server:9443\/GetTokens<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr class=\"Table_small_no_header\">\n\r<td class=\"Table_small_no_header\" style=\"background-color:#F4F5F4;\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTable\">Telo<\/span><\/p>\n\r<\/td>\n\r<td class=\"Table_small_no_header\" style=\"background-color:#F4F5F4;\"><p class=\"p_NormalTableCode\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTableCode\">{<\/span><\/p>\n\r<p class=\"p_NormalTableCode\" style=\"page-break-inside: avoid; page-break-after: avoid; margin: 0 6px 0 34px;\"><span class=\"f_NormalTableCode\">&quot;username&quot; : &quot;api&quot;,<\/span><\/p>\n\r<p class=\"p_NormalTableCode\" style=\"page-break-inside: avoid; page-break-after: avoid; margin: 0 6px 0 34px;\"><span class=\"f_NormalTableCode\">&quot;password&quot; : &quot;Admin.12345678&quot;,<\/span><\/p>\n\r<p class=\"p_NormalTableCode\" style=\"page-break-inside: avoid; page-break-after: avoid; margin: 0 6px 0 34px;\"><span class=\"f_NormalTableCode\">&quot;grant_type&quot; : &quot;password&quot;<\/span><\/p>\n\r<p class=\"p_NormalTableCode\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTableCode\">}<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 20px; margin-left: 0;\"><span class=\"f_Normal\" style=\"display:inline-block;width:20px;margin-left:-20px\">5.<\/span>Odpoveď vráti <span class=\"f_CodeHighlighted\">accessToken<\/span>. Následne môžete použiť <span class=\"f_CodeHighlighted\">accessToken<\/span> v ďalších požiadavkách API ako prístupový token (<span class=\"f_CodeHighlighted\">Authorization: Bearer<\/span>). V nástroji Swagger UI kliknite na <span class=\"f_UI\">Authorize<\/span>, vložte <span class=\"f_CodeHighlighted\">accessToken<\/span> a kliknite na <span class=\"f_UI\">Authorize<\/span>. Môžete vykonať ďalšie volania, pričom Swagger UI automaticky zahrnie autorizačný token do každého z nich.<\/p>\n\r<div style=\"text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 10px 0;\"><table class=\"Table_note\" >\n\r<tr class=\"Table_note\">\n\r<td class=\"Table_note\" style=\"width:4px; background-color:#3DAAE1;\"><br \/>\n\r<\/td>\n\r<td class=\"Table_note\" style=\"width:20px;\"><p class=\"p_Normal\"><img alt=\"Poznámka\" title=\"Poznámka\" width=\"20\" height=\"20\" style=\"margin:2px 0 0 0;width:20px;height:20px;border:none\" src=\".\/images\/note.svg\"\/><\/p>\n\r<\/td>\n\r<td class=\"Table_note\"><p class=\"p_Normal\">Pozrite si tiež <a href=\"how_api_works.html#examples\" class=\"topiclink\">príklady volaní API<\/a> a <a href=\"api.html\" class=\"topiclink\">zoznam všetkých volaní API<\/a>, ktoré sú k dispozícii v rámci ESET PROTECT On-Prem.<\/p>\n\r<\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r"
})
