Initiating a Scan
To start a scan via API:
- Press /scan/start in the Scan section.
- Press Try it out.
- In the request body select a file for scanning or provide a link and specify scan settings.
- Press Execute.
Example for initiating a scan from a private repository:
curl -k -X POST "https://YOUR_SERVER/app/api/v1/scan/start" \
-H "accept: application/json" \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: multipart/form-data" \
-F "branch=BRANCH" \
-F "analyzeJsLibs=" \
-F "ruleSet=" \
-F "checkboxNoBuild=" \
-F "name=" \
-F "repoPassword=PASSWORD" \
-F "saveRepoCredentials=" \
-F "sourceEncoding=" \
-F "checkboxUseUserPatterns=" \
-F "visualStudio=" \
-F "checkboxAnalyzeLibs=" \
-F "repoLogin=LOGIN" \
-F "saveFile=" \
-F "incremental=" \
-F "languages=" \
-F "fileSelector=**/*" \
-F "uuid=" \
-F "link=WEB_URL" \
-F "nameEncoding=" \
-F "preset="
Example for initiating a scan of a source code archive:
curl -k -X POST "https://example.com/app/api/v1/scan/start" \
-H "accept: application/json" \
-H "Authorization: Bearer 12345" \
-H "Content-Type: multipart/form-data" \
-F "branch=main" \
-F "analyzeJsLibs=true" \
-F "ruleSet=default" \
-F "checkboxNoBuild=true" \
-F "name=MyProject" \
-F "repoPassword=secret" \
-F "saveRepoCredentials=true" \
-F "sourceEncoding=UTF-8" \
-F "checkboxUseUserPatterns=false" \
-F "visualStudio=true" \
-F "checkboxAnalyzeLibs=true" \
-F "repoLogin=mylogin" \
-F "saveFile=false" \
-F "incremental=false" \
-F "link=https://example.com/repo" \
-F "languages=JavaScript" \
-F "fileSelector=**/*" \
-F "uuid=1234-5678-91011" \
-F "file=@/path/to/file.exe;type=application/x-msdownload" \
-F "nameEncoding=UTF-8" \
-F "preset=high"
Get scan status:
curl -k -X GET "https://YOUR_SERVER/app/api/v1/scans/SCAN_UUID/compact" \
-H "accept: application/json" \
-H "Authorization: Bearer TOKEN"