JSON API
JSON API allows downloading scan results and information about detected vulnerabilities in the JSON format. DerScanner API requires preset. API setup instructions are available in the Admin Guide. To read the specification:
- Go to the User profile section of UI (see Account).
- Get the authorization token for API.
- Click API Specification.
- Enter the authorization token for API.
Click Explore to see the list of possible requests. To make a request do the following:
- Click Authorize and enter authorization token.
- Click the required request.
- Click Try it out.
- Specify the parameters if necessary.
- Click Execute.
Once completed, these actions will be followed by a corresponding cURL request and response in the JSON format appearing on the screen.
API specification complies with the OpenAPI standard. API specification can be used to generate client and server libraries for accessing JSON APIs using OpenAPI Generator or Swagger Codegen.
Specification in JSON format can be accessed via HTTP using the GET request http://<installation_address>
/app/api/v1/openapi.json using an API authorization token. For example, to access a specification in JSON format, you can use the following cURL command
curl -H 'Authorization: Bearer <token>' \
http://<installation_address>/app/api/v1/openapi.json -o openapi.json
As a result of the command execution, the openapi.json file will be saved in the current directory. Then you can transfer it to a tool generating JSON API access libraries. For example, to generate a JSON API access Java library using OpenAPI Generator, you can use the following command:
java -jar openapi-generator-cli.jar generate -g java -i openapi.json
More details on the OpenAPI standard and capabilities of the tools generating API access libraries can be found in the official documentation.
Links:
- OpenAPI Specification
- OpenAPI Generator
- Swagger Codegen
- Other implementations and tools