Retrieving the target_id for a specific Target
This guide provides step-by-step instructions on how to retrieve the target_id for a specific target. By following the steps outlined in this guide, you will learn how to leverage the Acunetix API to enable seamless integration of Acunetix functionality into custom applications, scripts, or workflows.
There are two ways to generate the target_id:
How to retrieve the target_id through a GET request
Use the provided command to make a GET request to the Acunetix API and retrieve a list of targets with a filter applied.
Here is a breakdown of the command:
- https://127.0.0.1:3443/api/v1/targets?q=localhost: is the URL to which the GET request is sent. It includes the endpoint /api/v1/targets for retrieving targets and a filter q=localhost to filter the results based on target names or descriptions containing "localhost".
- -H "Accept: application/json": specifies that the client expects JSON-formatted responses from the server.
- -H "X-Auth: [API-Key]": provides authentication to the Acunetix API using an API key. Replace the API-Key with the actual API key.
curl -i -k -X GET https://127.0.0.1:3443/api/v1/targets?q=localhost -H "Accept: application/json" -H "X-Auth: [API-Key]" |
- The provided response includes information about a target, including its target_id. In this example, the target_id is: 1c17ddc4-8592-4744-98be-9d25703c6038. Here's the response with the target_id highlighted:
{ |
How to retrieve the target_id through the Acunetix UI
To navigate to the target settings inside the UI and copy the target_id from the URL, follow these steps:
- Log in to Acunetix.
- Navigate to the Targets section.
- Find the target for which you want to obtain the target_id.
- Click on the target to open its settings page.
- Look at the URL in your browser's address bar. It contains the target_id as a parameter in the URL.
- Copy the value of the target_id parameter from the URL.
For example, if the URL in the browser's address bar looks like this:
You would copy the value 1c17ddc4-8592-4744-98be-9d25703c6038, which is the target_id.