ESET PROTECT On-Prem

Offline | Go online

ESET PROTECT On-Prem – Table of Contents

# Set up the ESET PROTECT On-Prem REST API

Copy current article URL Share via email

Follow the steps below to set up the ESET PROTECT On-Prem REST API:

1.Enable the REST API in More > Settings.

|  | •Ensure to open the API ports in your local firewall. •To use the REST API, the peer certificate for the ESET PROTECT Server (whether used as the REST server certificate or not) must contain localhost in the Common name/Host field. If the peer (Server) certificate does not meet this requirement, create a new certificate and change the Server certificate.

2.Assign the API users the API permission set.

|  | The Administrator account cannot use the API.

3.To automate interactions with the ESET PROTECT On-Prem API, you can use the built-in Swagger UI (available since ESET PROTECT On-Prem version 13.1).

What is Swagger UI?

Swagger UI is an open-source framework that helps developers design, build, document, and consuming RESTful Web services. Using the Swagger UI, you can test the API calls through a web page: 1.Enable Swagger UI in the ESET PROTECT Server Settings. 2.The enabled built-in Swagger UI is accessible at https://localhost:9443/swagger. Replace localhost with the server name or IP address if needed. Swagger UI provides complete pre-fabricated API calls. You only need to change the parameter values in the calls.
|  | Swagger UI is available only in English.

Alternatively, you can implement API calls to your REST client application (for example, Postman) or you can use the command line (curl).

|  | The REST server runs locally on the ESET PROTECT Server. You cannot use ESET Connect with ESET PROTECT On-Prem REST API.

4.Execute the GetTokens request to log in to the REST server. In the Swagger UI, expand GetTokens > click Try it out > provide correct data in the request body and click Execute.

Method | POST
Function | getTokens
URL | https://protect_server:9443/GetTokens
Body | { "username" : "api", "password" : "Admin.12345678", "grant_type" : "password" }

5.The response returns the accessToken. You can subsequently use the accessToken in other API requests as a bearer token (Authorization: Bearer). In the Swagger UI, click Authorize > paste the accessToken > click Authorize. You can execute other calls, and Swagger UI automatically includes the authorization token in each call.

|  | See also the examples of API calls and the list of all API calls available in ESET PROTECT On-Prem.

˄˅