hmLoadTopic({
hmKeywords:"",
hmTitle:"Configurer l\'REST API ESET PROTECT On-Prem",
hmDescription:"Pour configurer l\'REST API ESET PROTECT On-Prem, procédez comme suit :",
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 > Configurer l\'REST API ESET PROTECT On-Prem",
hmHeader:"<h1 class=\"p_Heading1\"><span class=\"f_Heading1\">Configurer l\'REST API ESET PROTECT On-Prem<\/span><\/h1>\n\r",
hmBody:"<p class=\"p_Normal\">Pour configurer l\'REST API ESET PROTECT On-Prem, procédez comme suit :<\/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>Activez l\'REST API dans <span class=\"f_UI\">Plus<\/span> &gt; <a href=\"admin_server_settings.html#api\" class=\"topiclink\">Paramètres<\/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_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=\"IMPORTANT\" title=\"IMPORTANT\" 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>Veillez à ouvrir les ports API dans votre pare-feu local.<\/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>Pour utiliser REST API, le certificat homologue d\'ESET PROTECT Server (qu\'il soit utilisé ou non comme certificat de serveur REST) doit contenir <span class=\"f_CodeHighlighted\">localhost<\/span> dans le champ <span class=\"f_UI\">Nom commun<\/span>\/<span class=\"f_UI\">Hôte<\/span>. Si le certificat homologue (serveur) ne répond pas à cette exigence, <a href=\"certificates_certificate_era.html\" class=\"topiclink\">créez un nouveau certificat<\/a> et <a href=\"set_new_era_server_certificate.html\" class=\"topiclink\">remplacez le certificat serveur<\/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>Attribuez aux utilisateurs API le <a href=\"admin_ar_permissions_list.html\" class=\"topiclink\">jeu d\'autorisations<\/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=\"IMPORTANT\" title=\"IMPORTANT\" 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\">Le compte Administrateur ne peut pas utiliser l\'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>Pour automatiser les interactions avec l\'ESET PROTECT On-Prem API ESET PROTECT On-Prem, vous pouvez utiliser l\'<a href=\"admin_server_settings.html#api\" class=\"topiclink\">interface Swagger UIintégrée<\/a> (disponible depuis ESET PROTECT On-Prem version 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\">Qu\'est-ce qu\'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> est un framework open source qui permet aux développeurs de concevoir, de créer, de documenter et d\'utiliser des services web RESTful. À l\'aide de Swagger UI, vous pouvez tester les appels API via une page web :<\/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>Activez Swagger UI dans les <a href=\"admin_server_settings.html#api\" class=\"topiclink\">paramètres<\/a> ESET PROTECT Server.<\/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>L\'interface Swagger UI intégrée activée est accessible à l\'adresse <a href=\"https:\/\/localhost:9443\/swagger\" target=\"_blank\" onclick=\"return HMTrackTopiclink(this);\" class=\"weblink\">https:\/\/localhost:9443\/swagger<\/a>. Remplacez <span class=\"f_CodeHighlighted\">localhost<\/span> par le nom du serveur ou l\'adresse IP si nécessaire.<\/p>\n\r<p class=\"p_Normal\">Swagger UI fournit <a href=\"api.html\" class=\"topiclink\">des appels API précréés complets<\/a>. Il vous suffit de modifier les valeurs des paramètres dans les appels.<\/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=\"Remarque\" title=\"Remarque\" 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 n\'est disponible qu\'en anglais.<\/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\">Vous pouvez aussi implémenter des appels API à votre application cliente REST (par exemple, <a href=\"https:\/\/www.postman.com\/\" target=\"_blank\" onclick=\"return HMTrackTopiclink(this);\" class=\"weblink\">Postman<\/a>) ou vous pouvez utiliser la ligne de commande (<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=\"Remarque\" title=\"Remarque\" 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\">Le serveur REST s\'exécute localement sur ESET PROTECT Server. Vous ne pouvez pas utiliser ESET Connect avec l\'REST API ESET PROTECT On-Prem.<\/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>Exécutez la requête <span class=\"f_CodeHighlighted\"><a href=\"https:\/\/help.eset.com\/getHelp?product=protect_admin&amp;version=13.1&amp;lang=fr-FR&amp;topic=api_GetTokens_post\" onclick=\"return HMTrackTopiclink(this);\" class=\"weblink\">GetTokens<\/a><\/span> pour vous connecter au serveur REST : Dans l\'interface Swagger UI, développez <span class=\"f_CodeHighlighted\">GetTokens<\/span>, cliquez sur <span class=\"f_UI\">Essayer<\/span>, fournissez des données correctes dans le corps de la demande, puis cliquez sur <span class=\"f_UI\">Exécuter<\/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\">Méthode<\/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\">Fonction<\/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\">Corps<\/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>La réponse renvoie le jeton <span class=\"f_CodeHighlighted\">accessToken<\/span>. Vous pouvez ensuite utiliser <span class=\"f_CodeHighlighted\">accessToken<\/span> dans d\'autres requêtes API comme jeton du porteur (<span class=\"f_CodeHighlighted\">Authorization: Bearer<\/span>). Dans l\'interface Swagger UI, cliquez sur <span class=\"f_UI\">Autoriser<\/span> &gt;, collez le jeton <span class=\"f_CodeHighlighted\">accessToken<\/span>, puis cliquez sur le bouton <span class=\"f_UI\">Autoriser<\/span>. Vous pouvez effectuer d\'autres appels. Swagger UI inclut automatiquement le jeton d\'autorisation dans chaque appel.<\/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=\"Remarque\" title=\"Remarque\" 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\">Voir aussi les <a href=\"how_api_works.html#examples\" class=\"topiclink\">exemples d\'appels API<\/a> et la <a href=\"api.html\" class=\"topiclink\">liste de tous les appels API<\/a> disponibles dans ESET PROTECT On-Prem.<\/p>\n\r<\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r"
})
