- Checkmarx Documentation
- Checkmarx SAST
- SAST API Guide
- CXSAST (REST) API
- CxSAST (REST) API v4
- SAST
SAST
Gets details of all Result States
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"0"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("GET", "https://***.***.***.***/cxrestapi/help/sast/resultStates", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/resultStates"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString());
const headers = { 'Accept':'0', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/resultStates', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': '0', 'Authorization': 'Bearer {access-token}' } r = requests.get('https://***.***.***.***/cxrestapi/help/sast/resultStates', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => '0', 'Authorization' => 'Bearer {access-token}' } result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/resultStates', params: { }, headers: headers p JSON.parse(result)
GET /sast/resultStates
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Inline |
Response Schema
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Creates a Result State
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Content-Type": []string{"application/json;v=4.0"}, "Accept": []string{"application/json;v=4.0"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "https://***.***.***.***/cxrestapi/help/sast/resultStates", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/resultStates"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString());
const inputBody = '{ "names": [ { "languageId": 1033, "name": "To Verify" }, { "languageId": 1034, "name": "Para verificar" } ], "permission": "set-result-state-toverify" }'; const headers = { 'Content-Type':'application/json;v=4.0', 'Accept':'application/json;v=4.0', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/resultStates', { method: 'POST', body: inputBody, headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Content-Type': 'application/json;v=4.0', 'Accept': 'application/json;v=4.0', 'Authorization': 'Bearer {access-token}' } r = requests.post('https://***.***.***.***/cxrestapi/help/sast/resultStates', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Content-Type' => 'application/json;v=4.0', 'Accept' => 'application/json;v=4.0', 'Authorization' => 'Bearer {access-token}' } result = RestClient.post 'https://***.***.***.***/cxrestapi/help/sast/resultStates', params: { }, headers: headers p JSON.parse(result)
POST /sast/resultStates
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | true | Result State details | |
» names | body | true | none | |
»» languageId | body | integer(int32) | true | none |
»» name | body | string | true | none |
» permission | body | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ||
400 | Bad Request | None |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Get all scheduled jobs
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=4.0"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("GET", "https://***.***.***.***/cxrestapi/help/sast/scheduledJobs", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/scheduledJobs"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString());
const headers = { 'Accept':'application/json;v=4.0', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/scheduledJobs', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': 'application/json;v=4.0', 'Authorization': 'Bearer {access-token}' } r = requests.get('https://***.***.***.***/cxrestapi/help/sast/scheduledJobs', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=4.0', 'Authorization' => 'Bearer {access-token}' } result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/scheduledJobs', params: { }, headers: headers p JSON.parse(result)
GET /sast/scheduledJobs
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | Ok | Inline | |
400 | Bad Request | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | false | none | none | |
» projectId | integer(int64) | false | none | none |
» projectName | string | false | none | none |
» scanDays | [string] | false | none | none |
» scanTime | string | false | none | none |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Gets the scan settings
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=4.0"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("GET", "https://***.***.***.***/cxrestapi/help/sast/scanSettings/{projectId}", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/scanSettings/{projectId}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString());
const headers = { 'Accept':'application/json;v=4.0', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/scanSettings/{projectId}', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': 'application/json;v=4.0', 'Authorization': 'Bearer {access-token}' } r = requests.get('https://***.***.***.***/cxrestapi/help/sast/scanSettings/{projectId}', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=4.0', 'Authorization' => 'Bearer {access-token}' } result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/scanSettings/{projectId}', params: { }, headers: headers p JSON.parse(result)
GET /sast/scanSettings/{projectId}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
projectId | path | integer(int64) | true | Unique Id of the specific Project |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Cx.Sast.ScanSettings.Presentation.Dtos.ScanSettingsResponseDtoV4 | |
400 | Bad Request | None |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Get comment and timestamp for result update
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=4.0"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("GET", "https://***.***.***.***/cxrestapi/help/sast/resultPathCommentsHistory", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/resultPathCommentsHistory?id=0&pathId=0&commentToDisplay=All"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString());
const headers = { 'Accept':'application/json;v=4.0', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/resultPathCommentsHistory?id=0&pathId=0&commentToDisplay=All', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': 'application/json;v=4.0', 'Authorization': 'Bearer {access-token}' } r = requests.get('https://***.***.***.***/cxrestapi/help/sast/resultPathCommentsHistory', params={ 'id': '0', 'pathId': '0', 'commentToDisplay': 'All' }, headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=4.0', 'Authorization' => 'Bearer {access-token}' } result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/resultPathCommentsHistory', params: { 'id' => 'integer(int64)', 'pathId' => 'integer(int64)', 'commentToDisplay' => 'string' }, headers: headers p JSON.parse(result)
GET /sast/resultPathCommentsHistory
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | query | integer(int64) | true | Unique ID of a specific scan |
pathId | query | integer(int64) | true | Unique Id of the result path |
commentToDisplay | query | string | true | Comment to display (All or latest) , default value is “All” |
Enumerated Values
Parameter | Value |
---|---|
commentToDisplay | All |
commentToDisplay | Latest |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | Ok | ||
404 | Not Found | None |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Update the scan settings
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Content-Type": []string{"application/json;v=4.0"}, "Accept": []string{"application/json;v=4.0"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("PUT", "https://***.***.***.***/cxrestapi/help/sast/scanSettings", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/scanSettings"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("PUT"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString());
const inputBody = '{ "projectId": 1, "presetId": 1, "engineConfigurationId": 1, "postScanActionId": 1, "emailNotifications": { "failedScan": [ "string" ], "beforeScan": [ "string" ], "afterScan": [ "string" ] }, "postScanActionConditions": { "runOnlyWhenNewResults": true, "runOnlyWhenNewResultsMinSeverity": 3 }, "postScanActionArguments": "string" }'; const headers = { 'Content-Type':'application/json;v=4.0', 'Accept':'application/json;v=4.0', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/scanSettings', { method: 'PUT', body: inputBody, headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Content-Type': 'application/json;v=4.0', 'Accept': 'application/json;v=4.0', 'Authorization': 'Bearer {access-token}' } r = requests.put('https://***.***.***.***/cxrestapi/help/sast/scanSettings', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Content-Type' => 'application/json;v=4.0', 'Accept' => 'application/json;v=4.0', 'Authorization' => 'Bearer {access-token}' } result = RestClient.put 'https://***.***.***.***/cxrestapi/help/sast/scanSettings', params: { }, headers: headers p JSON.parse(result)
PUT /sast/scanSettings
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | Cx.Sast.ScanSettings.Presentation.Dtos.ScanSettingsRequestDtoV4 | true | Scan settings details |
» projectId | body | integer(int64) | true | none |
» presetId | body | integer(int64) | true | none |
» engineConfigurationId | body | integer(int64) | true | none |
» postScanActionId | body | integer(int64) | false | none |
» emailNotifications | body | Cx.Sast.ScanSettings.Presentation.Dtos.EmailNotificationsDto | false | none |
»» failedScan | body | [string] | false | none |
»» beforeScan | body | [string] | false | none |
»» afterScan | body | [string] | false | none |
» postScanActionConditions | body | Cx.Sast.ScanSettings.Presentation.Dtos.PostScanActionConditionsDto | false | none |
»» runOnlyWhenNewResults | body | boolean | false | none |
»» runOnlyWhenNewResultsMinSeverity | body | integer(int32) | false | none |
» postScanActionArguments | body | string | false | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ||
400 | Bad Request | None |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Define the scan settings
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Content-Type": []string{"application/json;v=4.0"}, "Accept": []string{"application/json;v=4.0"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "https://***.***.***.***/cxrestapi/help/sast/scanSettings", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/scanSettings"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString());
const inputBody = '{ "projectId": 1, "presetId": 1, "engineConfigurationId": 1, "postScanActionId": 1, "emailNotifications": { "failedScan": [ "string" ], "beforeScan": [ "string" ], "afterScan": [ "string" ] }, "postScanActionConditions": { "runOnlyWhenNewResults": true, "runOnlyWhenNewResultsMinSeverity": 3 }, "postScanActionArguments": "string" }'; const headers = { 'Content-Type':'application/json;v=4.0', 'Accept':'application/json;v=4.0', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/scanSettings', { method: 'POST', body: inputBody, headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Content-Type': 'application/json;v=4.0', 'Accept': 'application/json;v=4.0', 'Authorization': 'Bearer {access-token}' } r = requests.post('https://***.***.***.***/cxrestapi/help/sast/scanSettings', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Content-Type' => 'application/json;v=4.0', 'Accept' => 'application/json;v=4.0', 'Authorization' => 'Bearer {access-token}' } result = RestClient.post 'https://***.***.***.***/cxrestapi/help/sast/scanSettings', params: { }, headers: headers p JSON.parse(result)
POST /sast/scanSettings
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | Cx.Sast.ScanSettings.Presentation.Dtos.ScanSettingsRequestDtoV4 | true | Scan settings details |
» projectId | body | integer(int64) | true | none |
» presetId | body | integer(int64) | true | none |
» engineConfigurationId | body | integer(int64) | true | none |
» postScanActionId | body | integer(int64) | false | none |
» emailNotifications | body | Cx.Sast.ScanSettings.Presentation.Dtos.EmailNotificationsDto | false | none |
»» failedScan | body | [string] | false | none |
»» beforeScan | body | [string] | false | none |
»» afterScan | body | [string] | false | none |
» postScanActionConditions | body | Cx.Sast.ScanSettings.Presentation.Dtos.PostScanActionConditionsDto | false | none |
»» runOnlyWhenNewResults | body | boolean | false | none |
»» runOnlyWhenNewResultsMinSeverity | body | integer(int32) | false | none |
» postScanActionArguments | body | string | false | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ||
400 | Bad Request | None |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Update scan as locked
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=4.0"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("PUT", "https://***.***.***.***/cxrestapi/help/sast/lockScan", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/lockScan?id=0"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("PUT"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString());
const headers = { 'Accept':'application/json;v=4.0', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/lockScan?id=0', { method: 'PUT', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': 'application/json;v=4.0', 'Authorization': 'Bearer {access-token}' } r = requests.put('https://***.***.***.***/cxrestapi/help/sast/lockScan', params={ 'id': '0' }, headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=4.0', 'Authorization' => 'Bearer {access-token}' } result = RestClient.put 'https://***.***.***.***/cxrestapi/help/sast/lockScan', params: { 'id' => 'integer(int64)' }, headers: headers p JSON.parse(result)
PUT /sast/lockScan
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | query | integer(int64) | true | Unique ID of a specific scan |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | boolean | |
400 | Bad Request | None |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Update scan as unLocked
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=4.0"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("PUT", "https://***.***.***.***/cxrestapi/help/sast/unLockScan", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/unLockScan?id=0"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("PUT"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString());
const headers = { 'Accept':'application/json;v=4.0', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/unLockScan?id=0', { method: 'PUT', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': 'application/json;v=4.0', 'Authorization': 'Bearer {access-token}' } r = requests.put('https://***.***.***.***/cxrestapi/help/sast/unLockScan', params={ 'id': '0' }, headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=4.0', 'Authorization' => 'Bearer {access-token}' } result = RestClient.put 'https://***.***.***.***/cxrestapi/help/sast/unLockScan', params: { 'id' => 'integer(int64)' }, headers: headers p JSON.parse(result)
PUT /sast/unLockScan
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | query | integer(int64) | true | Unique ID of a specific scan |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | boolean | |
400 | Bad Request | None |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Creates a new scan
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Content-Type": []string{"application/x-www-form-urlencoded"}, "Accept": []string{"application/json;v=4.0"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "https://***.***.***.***/cxrestapi/help/sast/scanWithSettings", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/scanWithSettings"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString());
const inputBody = '{ "projectId": 0, "overrideProjectSetting": "false", "isIncremental": "false", "isPublic": "true", "forceScan": "true", "comment": "string", "presetId": 0, "engineConfigurationId": 0, "customFields": "string", "postScanActionId": 0, "runPostScanOnlyWhenNewResults": "false", "runPostScanMinSeverity": "0", "postScanActionArguments": "string", "zippedSource": "string" }'; const headers = { 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json;v=4.0', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/scanWithSettings', { method: 'POST', body: inputBody, headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json;v=4.0', 'Authorization': 'Bearer {access-token}' } r = requests.post('https://***.***.***.***/cxrestapi/help/sast/scanWithSettings', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Content-Type' => 'application/x-www-form-urlencoded', 'Accept' => 'application/json;v=4.0', 'Authorization' => 'Bearer {access-token}' } result = RestClient.post 'https://***.***.***.***/cxrestapi/help/sast/scanWithSettings', params: { }, headers: headers p JSON.parse(result)
POST /sast/scanWithSettings
projectId: 0 overrideProjectSetting: "false" isIncremental: "false" isPublic: "true" forceScan: "true" comment: string presetId: 0 engineConfigurationId: 0 customFields: string postScanActionId: 0 runPostScanOnlyWhenNewResults: "false" runPostScanMinSeverity: "0" postScanActionArguments: string zippedSource: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» projectId | body | integer | true | Specifies the Unique Id of the specific project to be scanned |
» overrideProjectSetting | body | boolean | false | Specifies whether to overwrite project settings to be the default for the next scans .If set to false or empty - do not overwrite project settings. If set to true - overwrite project settings |
» isIncremental | body | boolean | false | Specifies whether the scan is incremental of full |
» isPublic | body | boolean | false | Specifies whether the requested scan is public or private |
» forceScan | body | boolean | false | Specifies whether the code should be scanned regardless of unchanged code |
» comment | body | string | false | Specifies the scan comment |
» presetId | body | integer | false | Specify the preset id to use during the scan, 0 = use project’s default |
» engineConfigurationId | body | integer | false | Specify the engine-configuration to use during the scan, 0 = use project’s default |
» customFields | body | string | false | Any custom fields used to tag the scan. Example: {“key1”:“val1”,“key2”:“val2”} |
» postScanActionId | body | integer | false | Specify post action to be executed after scan is completed |
» runPostScanOnlyWhenNewResults | body | boolean | false | Specify if the configured post scan action will be executed only if new results are found, compared to the previous scan. Used in conjunction with PostScanActionId. |
» runPostScanMinSeverity | body | integer | false | Specify the minimal severity value when evaluating new results compared to the previous scan. Used in conjunction with RunPostScanOnlyWhenNewResults. |
» postScanActionArguments | body | string | false | Specify the additional arguments to add to the post scan action. Used in conjunction with PostScanActionId. |
» zippedSource | body | string(binary) | false | source Zip |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | ||
400 | Bad Request | None | |
404 | Not Found | None |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Sets a Result State to Deprecated status
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=4.0"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("DELETE", "https://***.***.***.***/cxrestapi/help/sast/resultStates/{id}", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/resultStates/{id}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("DELETE"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString());
const headers = { 'Accept':'application/json;v=4.0', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/resultStates/{id}', { method: 'DELETE', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': 'application/json;v=4.0', 'Authorization': 'Bearer {access-token}' } r = requests.delete('https://***.***.***.***/cxrestapi/help/sast/resultStates/{id}', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=4.0', 'Authorization' => 'Bearer {access-token}' } result = RestClient.delete 'https://***.***.***.***/cxrestapi/help/sast/resultStates/{id}', params: { }, headers: headers p JSON.parse(result)
DELETE /sast/resultStates/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer(int32) | true | The Id of the Result State |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | Inline | |
400 | Bad Request | None | |
404 | Not Found | None |
Response Schema
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Updates a Result State
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Content-Type": []string{"application/json;v=4.0"}, "Accept": []string{"application/json;v=4.0"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("PATCH", "https://***.***.***.***/cxrestapi/help/sast/resultStates/{id}", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/resultStates/{id}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("PATCH"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString());
const inputBody = '{ "names": [ { "languageId": 1033, "name": "To Verify" }, { "languageId": 1034, "name": "Para verificar" } ], "permission": "set-result-state-toverify" }'; const headers = { 'Content-Type':'application/json;v=4.0', 'Accept':'application/json;v=4.0', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/resultStates/{id}', { method: 'PATCH', body: inputBody, headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Content-Type': 'application/json;v=4.0', 'Accept': 'application/json;v=4.0', 'Authorization': 'Bearer {access-token}' } r = requests.patch('https://***.***.***.***/cxrestapi/help/sast/resultStates/{id}', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Content-Type' => 'application/json;v=4.0', 'Accept' => 'application/json;v=4.0', 'Authorization' => 'Bearer {access-token}' } result = RestClient.patch 'https://***.***.***.***/cxrestapi/help/sast/resultStates/{id}', params: { }, headers: headers p JSON.parse(result)
PATCH /sast/resultStates/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer(int32) | true | The Id of the Result State |
body | body | true | The Result State details | |
» names | body | false | none | |
»» languageId | body | integer(int32) | true | none |
»» name | body | string | true | none |
» permission | body | string | false | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Inline | |
400 | Bad Request | None | |
404 | Not Found | None |
Response Schema
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )