REST API 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 complete API endpoint reference is available on the 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 the URL of your TRON.ASOC. The same value appears in the host field of the Server section in the reference.
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-Keyheader; - 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:
- Open a terminal on your computer.
- Run the command and replace 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 of the access_token string for authentication.
Getting an API token for the API-Key header
For instructions on getting a token, see Getting an API token.