Setup and usage of the public API to automate creating projects and scans.
- Need an API Key? Request at firstname.lastname@example.org
- Detailed OpenAPI Documentation: https://docs.crashtest.cloud
Why should I use the API?
The API grants access to multiple features of the Crashtest Security Suite without human interaction, like clicking through the interface. Systems which need to update data dynamically are able to set up projects and start scans.
What do I need, in order to use the API?
In order to get started using the API, an API Key is required. Every key is unique for a single user and allows the user to interact with his/her stored data in the Crashtest Security Suite.
An API Key can be requested by sending an email to email@example.com
Once the key has been assigned, it must be attached to every request, which is sent to the API.
Where do I have to attach the API Key?
There are multiple ways of attaching the key. It can either be attached to the URL as a parameter or used as a header field within the request. Both versions allow the “api_key” attribute to be either fully lower or upper case.
As a parameter in the URL:
As a header attribute:
- API_KEY: my_secret_key
- api_key: my_secret_key
What can I do using the API?
The API is based on the Rest API format and allows sending GET, POST and DELETE requests. All available operations with a detailed specification can be found here. As the API Key is assigned to the user itself, it can be used to modify all teams, of which the user is a member.
Note: The same restrictions and permissions the user normally has, are also applied for the API.
For most requests, it is necessary to have some IDs in advance. An ID is a unique identifier that clarifies, which team, which project, … should be updated.
The team ID can be retrieved from the Local Storage of the Browser or by requesting the information at firstname.lastname@example.org
The Local Storage can be found by opening the developer tools of the browser.
- Click on the “Application” tab
- Select the local storage for “https://crashtest.cloud”
- Check the “user” entry for the “active_team_id”
When switching between different teams, this value will update and represent the newly selected team.
There are two ways of retrieving the ID of a project.
- If the project is created using the API, the response of the “create API” call contains the ID of the project.
- The project ID can be found by clicking on the User Interface on a single project. Afterwards, the URL in the browser shows a URL like https://crashtest.cloud/projects/123
The “123” at the end is in this case the ID of the specific project.
When starting a scan using the API, the response of the call contains the ID of the scan:
If the API call to start a new scan is used, while another scan for the same project is already running, the API call returns the ID of the running scan.
Currently, the API offers the following operations:
- Create a new project
- Delete a project
- Start a new scan for a project
- Stop a running Scan
- Retrieve the status of a scan
- Retrieve the finding for a scan (PDF, XML, JSON)