Skip to main content

How to list targets

Manage the targets in your account by listing them using pagination.

Step 1: List the targets (first page)

Start by listing the first page of targets.

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

The response returns the information on:

  • The total number of targets (”count”: 35).
  • The total number of pages (”page_total”: 4).
  • The current page (”page”: 1).
  • The page size (”length”: 10).
  • The list of targets on the page (”results”: [...]).
Response
{
"count": 35,
"page_total": 4,
"page": 1,
"length": 10,
"results": [
{
"id": "3jADZeNp5hSK",
"site": {
"id": "41rZjEiabKHP",
"name": "Target 1",
"desc": "",
"url": "http://example1.com/",
"host": "example1.com",
...
},
...
},
{
"id": "AfBQ3zcTXHAY",
"site": {
"id": "1HtZptu5mqpL",
"name": "Target 2",
"desc": "",
"url": "https://example2.com/",
"host": "example2.com",
...
},
...
},
...
]
}

Step 2: List the targets (second page)

Since there are more targets, list the targets on the second page by adding the page=2 query parameter.

Request
curl https://api.probely.com/targets/?page=2 \
-X GET \
-H 'Authorization: JWT <YOUR_API_TOKEN>' \
-H "Content-Type: application/json"

The response returns the second page (”page”: 2) with the second set of targets (”results”: [...]).

Response
{
"count": 35,
"page_total": 4,
"page": 2,
"length": 10,
"results": [
{
"id": "2AQXX1RWDmeo",
"site": {
"id": "41rBjEi1bKHP",
"name": "Target 11",
"desc": "",
"url": "http://example11.com/",
"host": "example11.com",
...
},
...
},
{
"id": "ApBQ7zcaXHAY",
"site": {
"id": "1Ht1Ztu5XqpL",
"name": "Target 12",
"desc": "",
"url": "https://example12.com/",
"host": "example12.com",
...
},
...
},
...
]
}

Change the page number to move on to the other pages with targets.

You can use other query parameters to adjust the pagination or to filter targets according to your needs. Check the API reference documentation on the List Targets endpoint for more details.