hmLoadTopic({
hmKeywords:"",
hmTitle:"設定 ESET PROTECT On-Prem REST API",
hmDescription:"請依照以下步驟設定 ESET PROTECT On-Prem REST API： 在 [更多] > [設定] 中啟用 REST API。   請務必在本機防火牆中開放 API 連接埠。 若要使用 REST API，ESET PROTECT 伺服器的對等憑證 (無論是否用作 REST 伺服器憑證) 必須在 [常用名稱]\/[主機] 欄位中包含 loca",
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 > 設定 ESET PROTECT On-Prem REST API",
hmHeader:"<h1 class=\"p_Heading1\"><span class=\"f_Heading1\">設定 ESET PROTECT On-Prem REST API<\/span><\/h1>\n\r",
hmBody:"<p class=\"p_Normal\">請依照以下步驟設定 ESET PROTECT On-Prem REST API：<\/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>在 <span class=\"f_UI\">[更多]<\/span> &gt; <a href=\"admin_server_settings.html#api\" class=\"topiclink\">[設定]<\/a> 中啟用 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=\"重要\" title=\"重要\" 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>請務必在本機防火牆中開放 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>若要使用 REST API，ESET PROTECT 伺服器的對等憑證 (無論是否用作 REST 伺服器憑證) 必須在 <span class=\"f_UI\">[常用名稱]<\/span>\/<span class=\"f_UI\">[主機]<\/span> 欄位中包含 <span class=\"f_CodeHighlighted\">localhost<\/span>。若對等 (伺服器) 憑證不符合此需求，則<a href=\"certificates_certificate_era.html\" class=\"topiclink\">建立新的憑證<\/a>並<a href=\"set_new_era_server_certificate.html\" class=\"topiclink\">變更伺服器憑證<\/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>將 <span class=\"f_UI\">API<\/span> <a href=\"admin_ar_permissions_list.html\" class=\"topiclink\">權限集合<\/a>指派給 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=\"重要\" title=\"重要\" 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\">管理員帳號無法使用 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>若要自動與 ESET PROTECT On-Prem API 進行互動，您可以使用 <a href=\"admin_server_settings.html#api\" class=\"topiclink\">內建 Swagger UI<\/a> (自 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\">什麼是 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> 是一個開放原始碼框架，協助開發人員設計、建置、記錄及使用 RESTful Web 服務。使用 Swagger UI，您可以透過網頁測試 API 呼叫：<\/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>在 ESET PROTECT 伺服器<a href=\"admin_server_settings.html#api\" class=\"topiclink\">設定<\/a>中啟用 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>啟用的內建 Swagger UI 可在 <a href=\"https:\/\/localhost:9443\/swagger\" target=\"_blank\" onclick=\"return HMTrackTopiclink(this);\" class=\"weblink\">https:\/\/localhost:9443\/swagger<\/a> 進行存取。如有需要，可以將 <span class=\"f_CodeHighlighted\">localhost<\/span> 取代為伺服器名稱或 IP 位址。<\/p>\n\r<p class=\"p_Normal\">Swagger UI 提供<a href=\"api.html\" class=\"topiclink\">完整的預製 API 呼叫<\/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=\"注意\" title=\"注意\" 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 僅提供英文版。<\/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\">或者，您可以實作 API 呼叫到您的 REST 用戶端應用程式 (例如，<a href=\"https:\/\/www.postman.com\/\" target=\"_blank\" onclick=\"return HMTrackTopiclink(this);\" class=\"weblink\">Postman<\/a>)，或者使用指令列 (<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=\"注意\" title=\"注意\" 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 伺服器會在 ESET PROTECT 伺服器上以本機方式執行。 您無法將 ESET Connect 搭配 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>執行 <span class=\"f_CodeHighlighted\"><a href=\"https:\/\/help.eset.com\/getHelp?product=protect_admin&amp;version=13.1&amp;lang=zh-TW&amp;topic=api_GetTokens_post\" onclick=\"return HMTrackTopiclink(this);\" class=\"weblink\">GetTokens<\/a><\/span> 請求以登入 REST 伺服器：在 Swagger UI，展開 <span class=\"f_CodeHighlighted\">GetTokens<\/span> &gt; 按一下 <span class=\"f_UI\">[嘗試看看]<\/span> &gt; 在請求主體中提供正確的資料，然後按一下 <span class=\"f_UI\">[執行]<\/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\">方法<\/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\">功能<\/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\">內文<\/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>回應會回傳 <span class=\"f_CodeHighlighted\">accessToken<\/span>。您接下來就可以在其他 API 請求中，將該 <span class=\"f_CodeHighlighted\">accessToken<\/span> 作為擁有者權杖 (<span class=\"f_CodeHighlighted\">Authorization: Bearer<\/span>) 來使用。在 Swagger UI，按一下 <span class=\"f_UI\">[授權]<\/span> &gt; 貼上 <span class=\"f_CodeHighlighted\">accessToken<\/span> &gt; 按一下 <span class=\"f_UI\">[授權]<\/span>。您可以執行其他呼叫，並且 Swagger UI 會在每次呼叫中自動包含授權權杖。<\/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=\"注意\" title=\"注意\" 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\">另請參閱 <a href=\"how_api_works.html#examples\" class=\"topiclink\">API 呼叫範例<\/a>及在 ESET PROTECT On-Prem 中可用的<a href=\"api.html\" class=\"topiclink\">所有 API 呼叫清單<\/a>。<\/p>\n\r<\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r"
})
