Skip to main content
Version: 1.6.1

REST API for TRON.ASOC

The TRON.ASOC REST API lets you perform the same actions as in the web interface: create and run security checks, work with projects, connect integrations, generate reports, and more.

The full API endpoint reference is available on a separate page. Each method includes request parameters, data schemas, response codes and bodies, and a ready-to-use curl command. The reference is based on the product's OpenAPI specification, which you can download.

Base URL: https://{host}/api/v1, where {host} is your TRON.ASOC URL. The same value goes in the host field of the Server block in the reference.

warning

You can't send a test request directly from the reference. Copy the curl command and run it from a network that can access your TRON.ASOC.

Authentication methods for the TRON.ASOC REST API​

You can authenticate in one of two ways:

  • with an API token in the API-Key header;
  • with a token in the Authorization: Bearer {your_token} header.

Getting a token for the Authorization: Bearer header​

To get a token, follow these steps:

  1. Open a terminal on your PC.
  2. Run the command, replacing the address with the address of your installation:
curl -X POST "https://{host}/api/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{
"username": "имя_вашей_учетной_записи_в_TRON.ASOC",
"password": "пароль"
}'

After you run the command, it returns the following response:

{
"id":"идентификатор_вашей_учетной_записи",
"email":"ваш_адрес_электронной_почты",
"username":"имя_вашей_учетной_записи_в_TRON.ASOC",
"display_name":"ваше_отображаемое_имя",
"access_token":"ваш_токен_для_авторизации",
"ttl":0,
"need_refresh_content":false
}

Use the value from the access_token line to authenticate.

Getting an API token for the API-Key header​

For instructions on getting a token, see Getting an API token.