Get potential security issues associated with multiple components
This is the current method that accepts ComponentsRequest for enhanced component identification
Replaces the deprecated GetIssues method
curl --request POST \
--url https://api.example.com/v2/semgrep/issues/components \
--header 'Content-Type: application/json' \
--data '
{
"components": [
{
"purl": "pkg:github/scanoss/engine@1.0.0"
},
{
"purl": "pkg:github/scanoss/scanoss.py@v1.30.0"
}
]
}
'import requests
url = "https://api.example.com/v2/semgrep/issues/components"
payload = { "components": [{ "purl": "pkg:github/scanoss/engine@1.0.0" }, { "purl": "pkg:github/scanoss/scanoss.py@v1.30.0" }] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
components: [
{purl: 'pkg:github/scanoss/engine@1.0.0'},
{purl: 'pkg:github/scanoss/scanoss.py@v1.30.0'}
]
})
};
fetch('https://api.example.com/v2/semgrep/issues/components', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v2/semgrep/issues/components",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'components' => [
[
'purl' => 'pkg:github/scanoss/engine@1.0.0'
],
[
'purl' => 'pkg:github/scanoss/scanoss.py@v1.30.0'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v2/semgrep/issues/components"
payload := strings.NewReader("{\n \"components\": [\n {\n \"purl\": \"pkg:github/scanoss/engine@1.0.0\"\n },\n {\n \"purl\": \"pkg:github/scanoss/scanoss.py@v1.30.0\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v2/semgrep/issues/components")
.header("Content-Type", "application/json")
.body("{\n \"components\": [\n {\n \"purl\": \"pkg:github/scanoss/engine@1.0.0\"\n },\n {\n \"purl\": \"pkg:github/scanoss/scanoss.py@v1.30.0\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/semgrep/issues/components")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"components\": [\n {\n \"purl\": \"pkg:github/scanoss/engine@1.0.0\"\n },\n {\n \"purl\": \"pkg:github/scanoss/scanoss.py@v1.30.0\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"components": [
{
"purl": "pkg:maven/org.apache.commons/commons-lang3",
"version": "3.12.0",
"requirement": "3.12.0",
"files": [
{
"fileMD5": "a1b2c3d4e5f6",
"path": "src/main/java/org/apache/commons/lang3/StringUtils.java",
"issues": [
{
"ruleID": "java.lang.security.audit.crypto.weak-hash",
"from": "156",
"to": "159",
"severity": "WARNING"
},
{
"ruleID": "java.lang.security.audit.sql-injection.sql-injection",
"from": "284",
"to": "286",
"severity": "ERROR"
}
]
},
{
"fileMD5": "b2c3d4e5f6a1",
"path": "src/main/java/org/apache/commons/lang3/Validate.java",
"issues": [
{
"ruleID": "java.lang.security.audit.hardcoded-secret",
"from": "95",
"to": "95",
"severity": "ERROR"
}
]
}
]
}
],
"status": {
"status": "SUCCESS",
"message": "Security analysis completed successfully"
}
}"<string>"{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Semgrep
Get potential security issues associated with multiple components This is the current method that accepts ComponentsRequest for enhanced component identification Replaces the deprecated GetIssues method
POST
/
v2
/
semgrep
/
issues
/
components
Get potential security issues associated with multiple components
This is the current method that accepts ComponentsRequest for enhanced component identification
Replaces the deprecated GetIssues method
curl --request POST \
--url https://api.example.com/v2/semgrep/issues/components \
--header 'Content-Type: application/json' \
--data '
{
"components": [
{
"purl": "pkg:github/scanoss/engine@1.0.0"
},
{
"purl": "pkg:github/scanoss/scanoss.py@v1.30.0"
}
]
}
'import requests
url = "https://api.example.com/v2/semgrep/issues/components"
payload = { "components": [{ "purl": "pkg:github/scanoss/engine@1.0.0" }, { "purl": "pkg:github/scanoss/scanoss.py@v1.30.0" }] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
components: [
{purl: 'pkg:github/scanoss/engine@1.0.0'},
{purl: 'pkg:github/scanoss/scanoss.py@v1.30.0'}
]
})
};
fetch('https://api.example.com/v2/semgrep/issues/components', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v2/semgrep/issues/components",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'components' => [
[
'purl' => 'pkg:github/scanoss/engine@1.0.0'
],
[
'purl' => 'pkg:github/scanoss/scanoss.py@v1.30.0'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v2/semgrep/issues/components"
payload := strings.NewReader("{\n \"components\": [\n {\n \"purl\": \"pkg:github/scanoss/engine@1.0.0\"\n },\n {\n \"purl\": \"pkg:github/scanoss/scanoss.py@v1.30.0\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v2/semgrep/issues/components")
.header("Content-Type", "application/json")
.body("{\n \"components\": [\n {\n \"purl\": \"pkg:github/scanoss/engine@1.0.0\"\n },\n {\n \"purl\": \"pkg:github/scanoss/scanoss.py@v1.30.0\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/semgrep/issues/components")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"components\": [\n {\n \"purl\": \"pkg:github/scanoss/engine@1.0.0\"\n },\n {\n \"purl\": \"pkg:github/scanoss/scanoss.py@v1.30.0\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"components": [
{
"purl": "pkg:maven/org.apache.commons/commons-lang3",
"version": "3.12.0",
"requirement": "3.12.0",
"files": [
{
"fileMD5": "a1b2c3d4e5f6",
"path": "src/main/java/org/apache/commons/lang3/StringUtils.java",
"issues": [
{
"ruleID": "java.lang.security.audit.crypto.weak-hash",
"from": "156",
"to": "159",
"severity": "WARNING"
},
{
"ruleID": "java.lang.security.audit.sql-injection.sql-injection",
"from": "284",
"to": "286",
"severity": "ERROR"
}
]
},
{
"fileMD5": "b2c3d4e5f6a1",
"path": "src/main/java/org/apache/commons/lang3/Validate.java",
"issues": [
{
"ruleID": "java.lang.security.audit.hardcoded-secret",
"from": "95",
"to": "95",
"severity": "ERROR"
}
]
}
]
}
],
"status": {
"status": "SUCCESS",
"message": "Security analysis completed successfully"
}
}"<string>"{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Body
application/json
Represents a list of software component to be analyzed by SCANOSS API services. Allows analysis of multiple software components in a single API call, improving performance over individual requests.
Represents a list of software component to be analyzed by SCANOSS API services. Allows analysis of multiple software components in a single API call, improving performance over individual requests.
Show child attributes
Show child attributes
Response
A successful response.
Components issue response data (JSON payload) Contains security issues detected by Semgrep analysis for multiple components. This is the current response format that replaces the deprecated SemgrepResponse.
⌘I