- Checkmarx Documentation
- Checkmarx SAST
- SAST API Guide
- CXSAST (REST) API
- CxSAST (REST) API v0.1
- SAST
SAST
Gets details of all Engine Servers
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=0.1"}, "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':'application/json;v=0.1', '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': 'application/json;v=0.1', 'Authorization': 'Bearer {access-token}' } r = requests.get('https://***.***.***.***/cxrestapi/help/sast/engineServers', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=0.1', '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
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [Cx.Sast.EngineServers.ApplicationContracts.DTOs.EngineServerResponse01Dto] | false | none | none |
» id | integer(int64) | false | none | none |
» name | string | false | read-only | none |
» uri | string | false | read-only | none |
» minLoc | integer(int32) | false | read-only | none |
» maxLoc | integer(int32) | false | read-only | none |
» isAlive | boolean | false | read-only | none |
» maxScans | integer(int32) | false | read-only | none |
» isBlocked | boolean | false | read-only | none |
» cxVersion | string | false | read-only | none |
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=0.1"}, "Accept": []string{"application/json;v=0.1"}, "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=0.1', 'Accept':'application/json;v=0.1', '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=0.1', 'Accept': 'application/json;v=0.1', '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=0.1', 'Accept' => 'application/json;v=0.1', '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 | ||
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 specific Engine Server
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=0.1"}, "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=0.1', '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=0.1', '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=0.1', '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.EngineServerResponse01Dto | |
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=0.1"}, "Accept": []string{"application/json;v=0.1"}, "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=0.1', 'Accept':'application/json;v=0.1', '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=0.1', 'Accept': 'application/json;v=0.1', '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=0.1', 'Accept' => 'application/json;v=0.1', '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=0.1"}, "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=0.1', '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=0.1', '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=0.1', '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=0.1"}, "Accept": []string{"application/json;v=0.1"}, "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=0.1', 'Accept':'application/json;v=0.1', '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=0.1', 'Accept': 'application/json;v=0.1', '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=0.1', 'Accept' => 'application/json;v=0.1', '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=0.1"}, "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=0.1', '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=0.1', '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=0.1', '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.SastScanRequestV01Dto] | 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 |
» 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 )