Skip to main content

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.1"},
        "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.1',
  '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.1',
  '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.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/scans/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

Parameters

Name

In

Type

Required

Description

id

path

integer(int64)

true

Unique ID of a specific scan

Responses

Status

Meaning

Description

Schema

200

OK

OK

Cx.Sast.ScanExecution.Presentation.Dtos.SastScansDtoV1_1

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)
OK

Responses

Status

Meaning

Description

Schema

200

OK

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.1"},
        "Accept": []string{"application/json;v=1.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=1.1',
  'Accept':'application/json;v=1.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=1.1',
  'Accept': 'application/json;v=1.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=1.1',
  'Accept' => 'application/json;v=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://***.***.***.***/cxrestapi/help/sast/engineServers',
  params: {
  }, headers: headers

p JSON.parse(result)
Body parameter

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

Created

Cx.Sast.EngineServers.Presentation.Dtos.CreateEngineServerDto

400

Bad Request

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.1"},
        "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.1',
  '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.1',
  '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.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/scansQueue/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

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

OK

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.1"},
        "Accept": []string{"application/json;v=1.1"},
        "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.1',
  'Accept':'application/json;v=1.1',
  '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.1',
  'Accept': 'application/json;v=1.1',
  '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.1',
  'Accept' => 'application/json;v=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.patch 'https://***.***.***.***/cxrestapi/help/sast/scansQueue/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)
Body parameter

Parameters

Name

In

Type

Required

Description

id

path

integer(int64)

true

Unique ID of a specific scan in the queue

body

body

Cx.Sast.ScanExecution.Presentation.Dtos.PatchScansQueue

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

OK

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.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=1.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=1.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=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

Parameters

Name

In

Type

Required

Description

id

path

integer(int64)

true

Unique Id of the specific Engine Server

OK

Responses

Status

Meaning

Description

Schema

200

OK

OK

Cx.Sast.EngineServers.ApplicationContracts.DTOs.EngineServerResponse11Dto

404

Not Found

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.1"},
        "Accept": []string{"application/json;v=1.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=1.1',
  'Accept':'application/json;v=1.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=1.1',
  'Accept': 'application/json;v=1.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=1.1',
  'Accept' => 'application/json;v=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)
Body parameter

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

OK

Cx.SuperTypes.API.Dtos.LinkedResource

400

Bad Request

Bad Request

None

404

Not Found

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.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=1.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=1.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=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete 'https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

Parameters

Name

In

Type

Required

Description

id

path

integer(int64)

true

Unique Id of the specific Engine Server

Responses

Status

Meaning

Description

Schema

204

No Content

Deleted

Inline

400

Bad Request

Bad Request

None

404

Not Found

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.1"},
        "Accept": []string{"application/json;v=1.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=1.1',
  'Accept':'application/json;v=1.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=1.1',
  'Accept': 'application/json;v=1.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=1.1',
  'Accept' => 'application/json;v=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.patch 'https://***.***.***.***/cxrestapi/help/sast/engineServers/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)
Body parameter

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

OK

Cx.SuperTypes.API.Dtos.LinkedResource

400

Bad Request

Bad Request

None

404

Not Found

Not Found

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 data retention request

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json;v=1.1"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://***.***.***.***/cxrestapi/help/sast/dataRetention/{requestId}/status", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/dataRetention/{requestId}/status");
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.1',
  'Authorization':'Bearer {access-token}'
};

fetch('https://***.***.***.***/cxrestapi/help/sast/dataRetention/{requestId}/status',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
import requests
headers = {
  'Accept': 'application/json;v=1.1',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://***.***.***.***/cxrestapi/help/sast/dataRetention/{requestId}/status', headers = headers)

print(r.json())
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json;v=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/dataRetention/{requestId}/status',
  params: {
  }, headers: headers

p JSON.parse(result)

Parameters

Name

In

Type

Required

Description

requestId

path

integer(int64)

true

Request id returned by sastor byDateRange

Ok

Responses

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.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=1.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=1.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=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/scansQueue',
  params: {
  }, headers: headers

p JSON.parse(result)

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

OK

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 the scan settings

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json;v=1.1"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "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?projectId=0");
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.1',
  'Authorization':'Bearer {access-token}'
};

fetch('https://***.***.***.***/cxrestapi/help/sast/scanSettings?projectId=0',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
import requests
headers = {
  'Accept': 'application/json;v=1.1',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://***.***.***.***/cxrestapi/help/sast/scanSettings', params={
  'projectId': '0'
}, headers = headers)

print(r.json())
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json;v=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/scanSettings',
  params: {
  'projectId' => 'integer(int64)'
}, headers: headers

p JSON.parse(result)

Parameters

Name

In

Type

Required

Description

projectId

query

integer(int64)

true

Unique Id of the specific Project

Responses

Status

Meaning

Description

Schema

200

OK

OK

Cx.Sast.ScanSettings.Presentation.Dtos.ScanSettingsResponseDto

400

Bad Request

Bad Request

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=1.1"},
        "Accept": []string{"application/json;v=1.1"},
        "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"
    ]
  }
}';
const headers = {
  'Content-Type':'application/json;v=1.1',
  'Accept':'application/json;v=1.1',
  '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=1.1',
  'Accept': 'application/json;v=1.1',
  '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=1.1',
  'Accept' => 'application/json;v=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://***.***.***.***/cxrestapi/help/sast/scanSettings',
  params: {
  }, headers: headers

p JSON.parse(result)
Body parameter

Parameters

Name

In

Type

Required

Description

body

body

Cx.Sast.ScanSettings.Presentation.Dtos.ScanSettingsRequestDto

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

Responses

Status

Meaning

Description

Schema

200

OK

OK

Cx.SuperTypes.API.Dtos.LinkedResource

400

Bad Request

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=1.1"},
        "Accept": []string{"application/json;v=1.1"},
        "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"
    ]
  }
}';
const headers = {
  'Content-Type':'application/json;v=1.1',
  'Accept':'application/json;v=1.1',
  '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=1.1',
  'Accept': 'application/json;v=1.1',
  '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=1.1',
  'Accept' => 'application/json;v=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://***.***.***.***/cxrestapi/help/sast/scanSettings',
  params: {
  }, headers: headers

p JSON.parse(result)
Body parameter

Parameters

Name

In

Type

Required

Description

body

body

Cx.Sast.ScanSettings.Presentation.Dtos.ScanSettingsRequestDto

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

Responses

Status

Meaning

Description

Schema

200

OK

OK

Cx.SuperTypes.API.Dtos.LinkedResource

400

Bad Request

Bad Request

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.1"},
        "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.1',
  '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.1',
  '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.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://***.***.***.***/cxrestapi/help/sast/scans',
  params: {
  }, headers: headers

p JSON.parse(result)

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

OK

Inline

Response Schema

Status Code 200

Name

Type

Required

Restrictions

Description

anonymous

[Cx.Sast.ScanExecution.Presentation.Dtos.SastScansDtoV1_1]

false

none

none

» id

integer(int64)

false

none

none

» project

Cx.Sast.ScanExecution.Presentation.Dtos.ProjectDto

false

none

none

»» id

integer(int64)

false

read-only

none

»» name

string

false

read-only

none

»» link

Cx.SuperTypes.API.Dtos.LinkDtoBase

false

none

none

»»» rel

string

false

read-only

none

»»» uri

string

false

read-only

none

» status

Cx.Sast.ScanExecution.Presentation.Dtos.ScanStatusDto

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

Cx.Sast.ScanExecution.Presentation.Dtos.DateAndTimeDto

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

Cx.SuperTypes.API.Dtos.LinkDtoBase

false

none

none

» scanState

Cx.Sast.ScanExecution.Presentation.Dtos.ScanStateDto

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

[Cx.Sast.ScanExecution.Domain.Entities.QueryLanguageState]

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

Cx.Sast.ScanExecution.Presentation.Dtos.EngineServerDto

false

none

none

»» id

integer(int64)

false

none

none

»» name

string

false

none

none

»» link

Cx.SuperTypes.API.Dtos.LinkDtoBase

false

none

none

» finishedScanStatus

string

false

none

none

» partialScanReasons

[Cx.Sast.ScanExecution.Domain.Entities.PartialScanDTO]

false

none

none

»» abortedMessage

string

false

none

none

»» abortedStatus

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.1"},
        "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,
  "postScanActionId": 0,
  "zippedSource": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json;v=1.1',
  '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.1',
  '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.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://***.***.***.***/cxrestapi/help/sast/scanWithSettings',
  params: {
  }, headers: headers

p JSON.parse(result)
Body parameter
projectId: 0
overrideProjectSetting: "false"
isIncremental: "false"
isPublic: "true"
forceScan: "true"
comment: string
presetId: 0
engineConfigurationId: 0
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

» 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

Created

Cx.SuperTypes.API.Dtos.LinkedResource

400

Bad Request

Bad Request

None

404

Not Found

Not Found

None

To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )

Stops data retention execution

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json;v=1.1"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://***.***.***.***/cxrestapi/help/sast/dataRetention/stop", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/dataRetention/stop");
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 headers = {
  'Accept':'application/json;v=1.1',
  'Authorization':'Bearer {access-token}'
};

fetch('https://***.***.***.***/cxrestapi/help/sast/dataRetention/stop',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
import requests
headers = {
  'Accept': 'application/json;v=1.1',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://***.***.***.***/cxrestapi/help/sast/dataRetention/stop', headers = headers)

print(r.json())
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json;v=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://***.***.***.***/cxrestapi/help/sast/dataRetention/stop',
  params: {
  }, headers: headers

p JSON.parse(result)

Responses

Status

Meaning

Description

Schema

202

Accepted

Accepted

Inline

Response Schema

To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )

Starts data retention execution, by given date range

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json;v=1.1"},
        "Accept": []string{"application/json;v=1.1"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://***.***.***.***/cxrestapi/help/sast/dataRetention/byDateRange", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/dataRetention/byDateRange");
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 = '{
  "startDate": "2019-08-24",
  "endDate": "2019-08-24",
  "durationLimitInHours": 0
}';
const headers = {
  'Content-Type':'application/json;v=1.1',
  'Accept':'application/json;v=1.1',
  'Authorization':'Bearer {access-token}'
};

fetch('https://***.***.***.***/cxrestapi/help/sast/dataRetention/byDateRange',
{
  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.1',
  'Accept': 'application/json;v=1.1',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://***.***.***.***/cxrestapi/help/sast/dataRetention/byDateRange', headers = headers)

print(r.json())
require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json;v=1.1',
  'Accept' => 'application/json;v=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://***.***.***.***/cxrestapi/help/sast/dataRetention/byDateRange',
  params: {
  }, headers: headers

p JSON.parse(result)
Body parameter

Parameters

Name

In

Type

Required

Description

body

body

DataRetention.Presentation.Dto.DataRetentionByDatesDto

true

Specify the data retention by dates range settings

» startDate

body

string(date)

true

none

» endDate

body

string(date)

true

none

» durationLimitInHours

body

integer(int64)

false

none

Responses

Status

Meaning

Description

Schema

202

Accepted

Accepted

Cx.SuperTypes.API.Dtos.LinkedResource

To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )

Starts data retention execution, by given number of last successful scans

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json;v=1.1"},
        "Accept": []string{"application/json;v=1.1"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://***.***.***.***/cxrestapi/help/sast/dataRetention/byNumberOfScans", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}
URL obj = new URL("https://***.***.***.***/cxrestapi/help/sast/dataRetention/byNumberOfScans");
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 = '{
  "numOfSuccessfulScansToPreserve": 0,
  "durationLimitInHours": 0
}';
const headers = {
  'Content-Type':'application/json;v=1.1',
  'Accept':'application/json;v=1.1',
  'Authorization':'Bearer {access-token}'
};

fetch('https://***.***.***.***/cxrestapi/help/sast/dataRetention/byNumberOfScans',
{
  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.1',
  'Accept': 'application/json;v=1.1',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://***.***.***.***/cxrestapi/help/sast/dataRetention/byNumberOfScans', headers = headers)

print(r.json())
require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json;v=1.1',
  'Accept' => 'application/json;v=1.1',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://***.***.***.***/cxrestapi/help/sast/dataRetention/byNumberOfScans',
  params: {
  }, headers: headers

p JSON.parse(result)
Body parameter

Parameters

Name

In

Type

Required

Description

body

body

DataRetention.Presentation.Dto.DataRetentionByAmountDto

true

Specify the data retention by number of last successful scans settings

» numOfSuccessfulScansToPreserve

body

integer(int32)

true

none

» durationLimitInHours

body

integer(int64)

false

none

Responses

Status

Meaning

Description

Schema

202

Accepted

Accepted

Cx.SuperTypes.API.Dtos.LinkedResource

To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )