- Checkmarx Documentation
- Checkmarx SAST
- SAST API Guide
- CXSAST (REST) API
- CxSAST (REST) API v1.2
- SAST
SAST
Gets details of a specific Scan
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=1.2"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("GET", "https://***.***.***.***/cxrestapi/help/sast/scans/{id}", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/scans/{id}"); 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=1.2', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/scans/{id}', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': 'application/json;v=1.2', 'Authorization': 'Bearer {access-token}' } r = requests.get('https://***.***.***.***/cxrestapi/help/sast/scans/{id}', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=1.2', 'Authorization' => 'Bearer {access-token}' } result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/scans/{id}', params: { }, headers: headers p JSON.parse(result)
GET /sast/scans/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer(int64) | true | Unique ID of a specific scan |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Gets details of all Engine Servers
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/engineServers", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/engineServers"); 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/engineServers', { 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/engineServers', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => '0', 'Authorization' => 'Bearer {access-token}' } result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/engineServers', params: { }, headers: headers p JSON.parse(result)
GET /sast/engineServers
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 )
Registers an Engine Server
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Content-Type": []string{"application/json;v=1.2"}, "Accept": []string{"application/json;v=1.2"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "https://***.***.***.***/cxrestapi/help/sast/engineServers", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/engineServers"); 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 = '{ "name": "string", "uri": "string", "minLoc": 0, "maxLoc": 0, "isBlocked": true, "maxScans": 0 }'; const headers = { 'Content-Type':'application/json;v=1.2', 'Accept':'application/json;v=1.2', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/engineServers', { 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=1.2', 'Accept': 'application/json;v=1.2', 'Authorization': 'Bearer {access-token}' } r = requests.post('https://***.***.***.***/cxrestapi/help/sast/engineServers', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Content-Type' => 'application/json;v=1.2', 'Accept' => 'application/json;v=1.2', 'Authorization' => 'Bearer {access-token}' } result = RestClient.post 'https://***.***.***.***/cxrestapi/help/sast/engineServers', params: { }, headers: headers p JSON.parse(result)
POST /sast/engineServers
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | Cx.Sast.EngineServers.ApplicationContracts.DTOs.EngineServerDTO | true | Engine Server details |
» name | body | string | true | none |
» uri | body | string | true | none |
» minLoc | body | integer(int32) | true | none |
» maxLoc | body | integer(int32) | true | none |
» isBlocked | body | boolean | true | none |
» maxScans | body | integer(int32) | false | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Cx.Sast.EngineServers.Presentation.Dtos.CreateEngineServerDto | |
400 | Bad Request | None |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Gets details of a scan in queue
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=1.2"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("GET", "https://***.***.***.***/cxrestapi/help/sast/scansQueue/{id}", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/scansQueue/{id}"); 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=1.2', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/scansQueue/{id}', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': 'application/json;v=1.2', 'Authorization': 'Bearer {access-token}' } r = requests.get('https://***.***.***.***/cxrestapi/help/sast/scansQueue/{id}', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=1.2', 'Authorization' => 'Bearer {access-token}' } result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/scansQueue/{id}', params: { }, headers: headers p JSON.parse(result)
GET /sast/scansQueue/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer(int64) | true | Filters the Scans Queue by an unique ID of a specific scan |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | none | Inline |
Response Schema
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Update status of a scan in queue
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Content-Type": []string{"application/json;v=1.2"}, "Accept": []string{"application/json;v=1.2"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("PATCH", "https://***.***.***.***/cxrestapi/help/sast/scansQueue/{id}", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/scansQueue/{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 = '{ "status": "Canceled" }'; const headers = { 'Content-Type':'application/json;v=1.2', 'Accept':'application/json;v=1.2', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/scansQueue/{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=1.2', 'Accept': 'application/json;v=1.2', 'Authorization': 'Bearer {access-token}' } r = requests.patch('https://***.***.***.***/cxrestapi/help/sast/scansQueue/{id}', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Content-Type' => 'application/json;v=1.2', 'Accept' => 'application/json;v=1.2', 'Authorization' => 'Bearer {access-token}' } result = RestClient.patch 'https://***.***.***.***/cxrestapi/help/sast/scansQueue/{id}', params: { }, headers: headers p JSON.parse(result)
PATCH /sast/scansQueue/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer(int64) | true | Unique ID of a specific scan in the queue |
body | body | true | ScanRequest data that is needed to be updated, Status options: Canceled | |
» status | body | string | true | none |
Enumerated Values
Parameter | Value |
---|---|
» status | Empty |
» status | Canceled |
» status | Postponed |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | none | Inline |
Response Schema
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Gets details of a specific Engine Server
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=1.2"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("GET", "https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}"); 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=1.2', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': 'application/json;v=1.2', 'Authorization': 'Bearer {access-token}' } r = requests.get('https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=1.2', 'Authorization' => 'Bearer {access-token}' } result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}', params: { }, headers: headers p JSON.parse(result)
GET /sast/engineServers/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer(int64) | true | Unique Id of the specific Engine Server |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Cx.Sast.EngineServers.ApplicationContracts.DTOs.EngineServerResponse12Dto | |
404 | Not Found | None |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Updates an Engine Server
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Content-Type": []string{"application/json;v=1.2"}, "Accept": []string{"application/json;v=1.2"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("PUT", "https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}"); 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 = '{ "name": "string", "uri": "string", "minLoc": 0, "maxLoc": 0, "isBlocked": true, "maxScans": 0 }'; const headers = { 'Content-Type':'application/json;v=1.2', 'Accept':'application/json;v=1.2', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}', { 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=1.2', 'Accept': 'application/json;v=1.2', 'Authorization': 'Bearer {access-token}' } r = requests.put('https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Content-Type' => 'application/json;v=1.2', 'Accept' => 'application/json;v=1.2', 'Authorization' => 'Bearer {access-token}' } result = RestClient.put 'https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}', params: { }, headers: headers p JSON.parse(result)
PUT /sast/engineServers/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer(int64) | true | Unique Id of the specific Engine Server |
body | body | Cx.Sast.EngineServers.ApplicationContracts.DTOs.EngineServerDTO | true | Engine Server details |
» name | body | string | true | none |
» uri | body | string | true | none |
» minLoc | body | integer(int32) | true | none |
» maxLoc | body | integer(int32) | true | none |
» isBlocked | body | boolean | true | none |
» maxScans | body | integer(int32) | false | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ||
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 )
Unregisters an Engine Server
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=1.2"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("DELETE", "https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/engineServers/{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=1.2', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}', { method: 'DELETE', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': 'application/json;v=1.2', 'Authorization': 'Bearer {access-token}' } r = requests.delete('https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=1.2', 'Authorization' => 'Bearer {access-token}' } result = RestClient.delete 'https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}', params: { }, headers: headers p JSON.parse(result)
DELETE /sast/engineServers/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer(int64) | true | Unique Id of the specific Engine Server |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | Deleted | 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 an Engine Server by edit single field
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Content-Type": []string{"application/json;v=1.2"}, "Accept": []string{"application/json;v=1.2"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("PATCH", "https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/engineServers/{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 = '{ "name": "string", "uri": "string", "minLoc": 0, "maxLoc": 0, "isBlocked": true, "maxScans": 0 }'; const headers = { 'Content-Type':'application/json;v=1.2', 'Accept':'application/json;v=1.2', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/engineServers/{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=1.2', 'Accept': 'application/json;v=1.2', 'Authorization': 'Bearer {access-token}' } r = requests.patch('https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Content-Type' => 'application/json;v=1.2', 'Accept' => 'application/json;v=1.2', 'Authorization' => 'Bearer {access-token}' } result = RestClient.patch 'https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}', params: { }, headers: headers p JSON.parse(result)
PATCH /sast/engineServers/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer(int64) | true | Unique Id of the specific Engine Server |
body | body | Cx.Sast.EngineServers.ApplicationContracts.Models.EngineServerPatchModel | true | Engine Server details |
» name | body | string | false | Engine Server name |
» uri | body | string | false | Engine Server Uri |
» minLoc | body | integer(int32) | false | Minimum LinesOfCode for the server |
» maxLoc | body | integer(int32) | false | Maximum LinesOfCode for the server |
» isBlocked | body | boolean | false | Flag to determine if EngineServer is blocked |
» maxScans | body | integer(int32) | false | Max concurrent scans |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ||
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 )
Gets scans in queue list
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=1.2"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("GET", "https://***.***.***.***/cxrestapi/help/sast/scansQueue", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/scansQueue"); 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=1.2', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/scansQueue', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': 'application/json;v=1.2', 'Authorization': 'Bearer {access-token}' } r = requests.get('https://***.***.***.***/cxrestapi/help/sast/scansQueue', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=1.2', 'Authorization' => 'Bearer {access-token}' } result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/scansQueue', params: { }, headers: headers p JSON.parse(result)
GET /sast/scansQueue
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
projectId | query | integer(int64) | false | Filters the Scans Queue by an unique ID of a specific project |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | none | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [Cx.Sast.ScanExecution.Presentation.Dtos.SastScanRequestV1_2DTO] | false | none | none |
» id | integer(int64) | false | none | none |
» stage | string | false | none | none |
» teamId | string | false | none | none |
» project | false | none | none | |
»» id | integer(int64) | false | read-only | none |
»» name | string | false | read-only | none |
» engineId | integer(int64) | false | none | none |
» loc | integer(int32) | false | none | none |
» languages | false | none | none | |
»» id | integer(int64) | false | none | none |
»» name | string | false | none | none |
» dateCreated | string(date-time) | false | none | none |
» queuedOn | string(date-time) | false | none | none |
» engineStartedOn | string(date-time) | false | none | none |
» engineFinishedOn | string(date-time) | false | none | none |
» isIncremental | boolean | false | none | none |
» isPublic | boolean | false | none | none |
» origin | string | false | none | none |
Enumerated Values
Property | Value |
---|---|
stage | New |
stage | PreScan |
stage | Queued |
stage | Scanning |
stage | PostScan |
stage | Finished |
stage | Canceled |
stage | Failed |
stage | SourcePullingAndDeployment |
stage | None |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Gets a collection of scans By Project
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=1.2"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("GET", "https://***.***.***.***/cxrestapi/help/sast/scans", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/scans"); 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=1.2', 'Authorization':'Bearer {access-token}' }; fetch('https://***.***.***.***/cxrestapi/help/sast/scans', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': 'application/json;v=1.2', 'Authorization': 'Bearer {access-token}' } r = requests.get('https://***.***.***.***/cxrestapi/help/sast/scans', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=1.2', 'Authorization' => 'Bearer {access-token}' } result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/scans', params: { }, headers: headers p JSON.parse(result)
GET /sast/scans
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
last | query | integer(int32) | false | Amount of the latest scans |
scanStatus | query | string | false | Specifies the scan stage |
projectId | query | integer(int64) | false | Unique ID of a specific project |
Enumerated Values
Parameter | Value |
---|---|
scanStatus | Scanning |
scanStatus | Finished |
scanStatus | Canceled |
scanStatus | Failed |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | false | none | none | |
» id | integer(int64) | false | none | none |
» project | false | none | none | |
»» id | integer(int64) | false | read-only | none |
»» name | string | false | read-only | none |
»» link | false | none | none | |
»»» rel | string | false | read-only | none |
»»» uri | string | false | read-only | none |
» status | false | none | none | |
»» id | integer(int64) | false | read-only | none |
»» name | string | false | read-only | none |
»» details | Cx.Sast.ScanExecution.Presentation.Dtos.ScanStatusDetailsDto | false | none | none |
»»» stage | string | false | read-only | none |
»»» step | string | false | read-only | none |
» scanType | string | false | none | none |
» comment | string | false | none | none |
» dateAndTime | false | none | none | |
»» startedOn | string(date-time) | false | read-only | none |
»» finishedOn | string(date-time) | false | read-only | none |
»» engineStartedOn | string(date-time) | false | read-only | none |
»» engineFinishedOn | string(date-time) | false | read-only | none |
» resultsStatistics | Cx.Sast.ScanExecution.Presentation.Dtos.ResultsStatisticsLink | false | none | none |
»» link | false | none | none | |
» scanState | false | none | none | |
»» path | string | false | none | none |
»» sourceId | string | false | none | none |
»» filesCount | integer(int64) | false | none | none |
»» linesOfCode | integer(int64) | false | none | none |
»» failedLinesOfCode | integer(int64) | false | none | none |
»» cxVersion | string | false | none | none |
»» languageStateCollection | false | none | none | |
»»» languageID | integer(int32) | false | none | none |
»»» languageName | string | false | none | none |
»»» languageHash | string | false | none | none |
»»» stateCreationDate | string(date-time) | false | none | none |
» owner | string | false | none | none |
» origin | string | false | none | none |
» originURL | string | false | none | none |
» initiatorName | string | false | none | none |
» owningTeamId | integer(int32) | false | none | none |
» isPublic | boolean | false | none | none |
» isLocked | boolean | false | none | none |
» isIncremental | boolean | false | none | none |
» scanRisk | integer(int64) | false | none | none |
» scanRiskSeverity | integer(int64) | false | none | none |
» engineServer | false | none | none | |
»» id | integer(int64) | false | none | none |
»» name | string | false | none | none |
»» link | false | none | none | |
» finishedScanStatus | string | false | none | none |
» partialScanReasons | false | none | none | |
»» abortedMessage | string | false | none | none |
»» abortedStatus | string | false | none | none |
» customFields | object | false | none | none |
»» additionalProperties | string | false | none | none |
Enumerated Values
Property | Value |
---|---|
scanType | Unknown |
scanType | AllScans |
scanType | Regular |
scanType | Subset |
scanType | Partial |
scanType | Running |
finishedScanStatus | None |
finishedScanStatus | Completed |
finishedScanStatus | Partial |
abortedStatus | None |
abortedStatus | Queries |
abortedStatus | Stages |
abortedStatus | QueriesExceededResultThreshold |
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=1.2"}, "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, "zippedSource": "string" }'; const headers = { 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json;v=1.2', '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=1.2', '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=1.2', '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 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 |
» 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 )