Internal API for fetching custom email templates and images from core server
Code Insight REST API Documentation (v1)
The Code Insight REST APIs provide a standardized interface for interacting with the application.
An authorization JWT token must be included in the HTTP Authorization header using the Bearer schema. The token can be obtained from the Code Insight Web UI under the Preferences menu. To set the token, click the Authorize button below on the right, enter the JWT token in the Value field, then click Authorize and close the dialog. Once authorized, the token will be automatically included in the HTTP Authorization header for all API requests made through the Swagger UI.
Note: If accessing the REST APIs through external tools such as curl or Postman, include the token manually in the HTTP header using the following format: Authorization: Bearer JWT_TOKEN. "Bearer" must precede the actual JWT token value.
- Mock serverhttps://codeinsightapi.redocly.app/_mock/swagger/rules
- Code Insight REST API Serverhttps://codeinsightapi.redocly.app/codeinsight/api/rules
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://codeinsightapi.redocly.app/_mock/swagger/rules?offset=1&limit=25' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'Request
Update existing rule.
Note: Value for detectionCriteria is an array of string Eg. detectionCriteria: ["filepath1 or folderpath1","filepath2 or folderpath2"].
Parameters fileInfo and ruleInfo are mutually exclusive. Only users with Library Manager role can update rules.
Update existing rule.
url
asFoundLicenseText
- Mock serverhttps://codeinsightapi.redocly.app/_mock/swagger/rules
- Code Insight REST API Serverhttps://codeinsightapi.redocly.app/codeinsight/api/rules
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
https://codeinsightapi.redocly.app/_mock/swagger/rules \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"id": 1,
"inventoryName": "Custom Inventory Name",
"componentId": 1,
"versionId": 1,
"licenseId": 1,
"description": "description",
"url": "https://www.flexera.com/",
"noticesText": "Sample Notices Text",
"auditNotes": "Sample Audit Notes",
"asFoundLicenseText": "Sample from file LICENSE.txt in file @file in the materials",
"fileInfo": [
{
"name": "fileName",
"md5": "md5"
}
],
"ruleInfo": [
{
"detectionType": "filePath",
"detectionCriteria": "[filepath]"
}
]
}'Request
Add new rule with either file info or rule info.
Note: Value for detectionCriteria is an array of string Eg. detectionCriteria: ["filepath1 or folderpath1","filepath2 or folderpath2"].
Parameters fileInfo and ruleInfo are mutually exclusive. Only users with Library Manager role can create rules.
Add new rule.
url
asFoundLicenseText
- Mock serverhttps://codeinsightapi.redocly.app/_mock/swagger/rules
- Code Insight REST API Serverhttps://codeinsightapi.redocly.app/codeinsight/api/rules
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://codeinsightapi.redocly.app/_mock/swagger/rules \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"inventoryName": "Custom Inventory Name",
"componentId": 1,
"versionId": 1,
"licenseId": 1,
"description": "description",
"url": "https://www.flexera.com/",
"noticesText": "Sample Notices Text",
"auditNotes": "Sample Audit Notes",
"asFoundLicenseText": "Sample from file LICENSE.txt in file @file in the materials",
"fileInfo": [
{
"name": "fileName",
"md5": "md5"
}
],
"ruleInfo": [
{
"detectionType": "filePath",
"detectionCriteria": "[filepath]"
}
]
}'- Mock serverhttps://codeinsightapi.redocly.app/_mock/swagger/rules/{ruleId}
- Code Insight REST API Serverhttps://codeinsightapi.redocly.app/codeinsight/api/rules/{ruleId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://codeinsightapi.redocly.app/_mock/swagger/rules/{ruleId}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'- Mock serverhttps://codeinsightapi.redocly.app/_mock/swagger/rules/{ruleId}
- Code Insight REST API Serverhttps://codeinsightapi.redocly.app/codeinsight/api/rules/{ruleId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
'https://codeinsightapi.redocly.app/_mock/swagger/rules/{ruleId}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'Request
Disable multiple rules by their IDs. Disabled rules will not be applied during project scanning. Only users with Library Manager role can disable rules.
List of rule IDs to disable
- Mock serverhttps://codeinsightapi.redocly.app/_mock/swagger/rules/disable
- Code Insight REST API Serverhttps://codeinsightapi.redocly.app/codeinsight/api/rules/disable
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
https://codeinsightapi.redocly.app/_mock/swagger/rules/disable \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '[
0
]'Request
Enable multiple rules. Enabled rules will be applied during project scanning. Only users with Library Manager role can enable rules.
List of rules ids to enable
- Mock serverhttps://codeinsightapi.redocly.app/_mock/swagger/rules/enable
- Code Insight REST API Serverhttps://codeinsightapi.redocly.app/codeinsight/api/rules/enable
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
https://codeinsightapi.redocly.app/_mock/swagger/rules/enable \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '[
0
]'