Skip to main content

Quick Start

In this quick example, we will start a scan for a target from a list and get the final scan results.

To run the requests, replace <YOUR_API_TOKEN> with your authentication token.
Read more about how to obtain the authentication token in the Authentication article.

Step 1: Get the list of targets

We will start with a request to get the list of targets of the account.

Get the list of targets
curl https://api.probely.com/targets/ \
-X GET \
-H 'Authorization: JWT <YOUR_API_TOKEN>' \
-H "Content-Type: application/json"

The response returns a JSON with the list of targets in your account.

Response
{
"count": 32,
"page_total": 4,
"page": 1,
"length": 10,
"results": [
{
"id": "3jWDZrNpfhSK",
"site": {
"id": "44rhjEiKbqHP",
"name": "My Website",
"desc": "",
"url": "https://www.example.com/",
...
},
...
},
...
]
}

Step 2: Start a target scan

With a list of targets, we will start a scan for the first target (with the identifier 3jWDZrNpfhSK).

Get the list of targets
curl https://api.probely.com/targets/3jWDZrNpfhSK/scan_now/ \
-X POST \
-H 'Authorization: JWT <YOUR_API_TOKEN>' \
-H "Content-Type: application/json"

The response returns a JSON with information about the scan, such as the scan identifier, the scan status, and the creation date.

Response
{
"id": "37borpHTaGDe",
"target": {
"id": "3jWDZrNpfhSK",
...
},
"status": "queued",
...
"created": "2023-11-15T15:14:20.650073Z",
...
}

Step 3: Get scan information

Now, we will poll Probely with the following request to get the scan information and check whether the scan is complete. We will use the scan identifier (37borpHTaGDe) and target identifier (3jWDZrNpfhSK) from the previous steps.

Get the list of targets
curl https://api.probely.com/targets/3jWDZrNpfhSK/scans/37borpHTaGDe/ \
-X GET \
-H 'Authorization: JWT <YOUR_API_TOKEN>' \
-H "Content-Type: application/json"

When the scan is complete, the response returns a JSON with the scan status as completed, together with the date and time of completion and the final number of vulnerabilities found (low, medium, and high).

Response
{
"id": "37borpHTaGDe",
"target": {
"id": "3jWDZrNpfhSK",
...
},
"status": "completed",
"started": "2023-11-15T15:14:22.971155Z",
"completed": "2023-11-15T15:57:52.888459Z",
"scan_profile": "api_normal",
"lows": 1,
"mediums": 2,
"highs": 24,
...
}

In this last step, we polled Probely to get the scan information and check whether it was complete. An alternative to this is to subscribe to Probely events and get notified about changes in your account. Learn more about the available events and how to subscribe to them in Events.