List scanner connectors and scan jobs
curl --request GET \
--url http://localhost:3000/api/scanners \
--header 'x-openlit-environment: <x-openlit-environment>' \
--header 'x-openlit-project-id: <x-openlit-project-id>'import requests
url = "http://localhost:3000/api/scanners"
headers = {
"x-openlit-project-id": "<x-openlit-project-id>",
"x-openlit-environment": "<x-openlit-environment>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'x-openlit-project-id': '<x-openlit-project-id>',
'x-openlit-environment': '<x-openlit-environment>'
}
};
fetch('http://localhost:3000/api/scanners', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/scanners",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-openlit-environment: <x-openlit-environment>",
"x-openlit-project-id: <x-openlit-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/api/scanners"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-openlit-project-id", "<x-openlit-project-id>")
req.Header.Add("x-openlit-environment", "<x-openlit-environment>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:3000/api/scanners")
.header("x-openlit-project-id", "<x-openlit-project-id>")
.header("x-openlit-environment", "<x-openlit-environment>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/scanners")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["x-openlit-project-id"] = '<x-openlit-project-id>'
request["x-openlit-environment"] = '<x-openlit-environment>'
response = http.request(request)
puts response.read_body{
"connectors": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"environment": "<string>",
"jobs": [
{
"id": "<string>",
"status": "queued",
"target": "<string>",
"ref": "<string>",
"cliVersion": "v0.1.8",
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"findingCount": 123,
"mediumPlusCount": 123,
"findings": [
{
"id": "<string>",
"ruleId": "<string>",
"severity": "<string>",
"path": "<string>",
"title": "<string>"
}
],
"error": "<string>"
}
]
}
]
}List scan jobs
Return scanner connectors for the current project and environment, including recent jobs and findings.
GET
/
api
/
scanners
List scanner connectors and scan jobs
curl --request GET \
--url http://localhost:3000/api/scanners \
--header 'x-openlit-environment: <x-openlit-environment>' \
--header 'x-openlit-project-id: <x-openlit-project-id>'import requests
url = "http://localhost:3000/api/scanners"
headers = {
"x-openlit-project-id": "<x-openlit-project-id>",
"x-openlit-environment": "<x-openlit-environment>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'x-openlit-project-id': '<x-openlit-project-id>',
'x-openlit-environment': '<x-openlit-environment>'
}
};
fetch('http://localhost:3000/api/scanners', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/scanners",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-openlit-environment: <x-openlit-environment>",
"x-openlit-project-id: <x-openlit-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/api/scanners"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-openlit-project-id", "<x-openlit-project-id>")
req.Header.Add("x-openlit-environment", "<x-openlit-environment>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:3000/api/scanners")
.header("x-openlit-project-id", "<x-openlit-project-id>")
.header("x-openlit-environment", "<x-openlit-environment>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/scanners")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["x-openlit-project-id"] = '<x-openlit-project-id>'
request["x-openlit-environment"] = '<x-openlit-environment>'
response = http.request(request)
puts response.read_body{
"connectors": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"environment": "<string>",
"jobs": [
{
"id": "<string>",
"status": "queued",
"target": "<string>",
"ref": "<string>",
"cliVersion": "v0.1.8",
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"findingCount": 123,
"mediumPlusCount": 123,
"findings": [
{
"id": "<string>",
"ruleId": "<string>",
"severity": "<string>",
"path": "<string>",
"title": "<string>"
}
],
"error": "<string>"
}
]
}
]
}List scanner connectors for the current project and environment. Each connector includes recent scan jobs and their findings — use this to read the data of a scan after Run scan.
Secrets are never returned.
See Scanner connectors for setup.
Was this page helpful?

