- Checkmarx Documentation
- Checkmarx SAST
- SAST API Guide
- CXSAST (REST) API
- CxSAST (REST) API v1.3
- GENERAL
GENERAL
Gets details of GIT source settings
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{"application/json;v=1.3"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("GET", "https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git"); 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.3', 'Authorization':'Bearer {access-token}' }; fetch('https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
import requests headers = { 'Accept': 'application/json;v=1.3', 'Authorization': 'Bearer {access-token}' } r = requests.get('https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'application/json;v=1.3', 'Authorization' => 'Bearer {access-token}' } result = RestClient.get 'https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git', params: { }, headers: headers p JSON.parse(result)
GET /projects/{id}/sourceCode/remoteSettings/git
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer(int64) | true | Unique Id of the specific project |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Cx.ProjectManagement.Presentation.Dtos.GetGitSourceSettingsDto |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Set project’s remote source settings as GIT
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Content-Type": []string{"application/json;v=1.3"}, "Accept": []string{"application/json;v=1.3"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git"); 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 = '{ "url": "string", "branch": "string", "authentication": "Undefined", "userName": "string", "password": "string", "pat": "string", "privateKey": "string" }'; const headers = { 'Content-Type':'application/json;v=1.3', 'Accept':'application/json;v=1.3', 'Authorization':'Bearer {access-token}' }; fetch('https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git', { 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.3', 'Accept': 'application/json;v=1.3', 'Authorization': 'Bearer {access-token}' } r = requests.post('https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Content-Type' => 'application/json;v=1.3', 'Accept' => 'application/json;v=1.3', 'Authorization' => 'Bearer {access-token}' } result = RestClient.post 'https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git', params: { }, headers: headers p JSON.parse(result)
POST /projects/{id}/sourceCode/remoteSettings/git
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer(int64) | true | Unique Id of the specific project |
body | body | Cx.ProjectManagement.Presentation.Dtos.GitSourceSettingsDtoV1_3 | true | GIT settings details |
» url | body | string | true | The URL which is used to connect to GIT repository |
» branch | body | string | true | The branch of a GIT repository |
» authentication | body | string | false | The authentication method which is used to connect to a private GIT repository |
» userName | body | string | false | The user name which is used to connect to GIT repository |
» password | body | string | false | The user password which is used to connect to GIT repository |
» pat | body | string | false | The user's personal access token (PAT) which is used to connect to GIT repository |
» privateKey | body | string | false | The private key which is used to connect to GIT repository using SSH protocol |
Enumerated Values
Parameter | Value |
---|---|
» authentication | Undefined |
» authentication | none |
» authentication | credentials |
» authentication | PAT |
» authentication | ssh |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Inline | |
400 | Bad Request | None |
Response Schema
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )
Set project’s remote source settings as GIT which uses SSH protocol
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.3"}, "Authorization": []string{"Bearer {access-token}"}, } data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git/ssh", data) req.Header = headers client := &http.Client{} resp, err := client.Do(req) // ... }
URL obj = new URL("https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git/ssh"); 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 = '{ "url": "string", "branch": "string", "privateKey": "string" }'; const headers = { 'Content-Type':'application/x-www-form-urlencoded', 'Accept':'application/json;v=1.3', 'Authorization':'Bearer {access-token}' }; fetch('https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git/ssh', { 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.3', 'Authorization': 'Bearer {access-token}' } r = requests.post('https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git/ssh', headers = headers) print(r.json())
require 'rest-client' require 'json' headers = { 'Content-Type' => 'application/x-www-form-urlencoded', 'Accept' => 'application/json;v=1.3', 'Authorization' => 'Bearer {access-token}' } result = RestClient.post 'https://10.32.9.160/cxrestapi/help/projects/{id}/sourceCode/remoteSettings/git/ssh', params: { }, headers: headers p JSON.parse(result)
POST /projects/{id}/sourceCode/remoteSettings/git/ssh
url: string branch: string privateKey: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Unique Id of the specific project |
body | body | object | true | none |
» url | body | string | true | The URL which is used to connect to GIT repository |
» branch | body | string | true | The branch of a GIT repository |
» privateKey | body | string(binary) | false | Private key which is used to connect to GIT repository using SSH protocol |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Inline | |
400 | Bad Request | None |
Response Schema
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )