Project API

Export Project Data

Use this API to export project data from a given project (identified by its projectId). Only Project Administrators and Analysts can execute this API.

The Try It feature is not available for this API. However, you can test the API using conventional REST API clients such as Postman or cURL. When calling this API from a REST client, run a curl command in the following format. (Note that you must redirect the output to a ZIP file, as shown in the command format.)

curl -X GET "http://{HOST}:{PORT}/codeinsight/api/project/exportProjectData?projectId={PROJECT_ID}" -H "accept: application/json" -H "Authorization: Bearer {JWT_TOKEN}" > export.zip
Request
query Parameters
projectId
required
integer <int32>

ID of the Project

Example: projectId=1
header Parameters
Authorization
required
string
Default:

Bearer JWT Token

Example: Bearer JWT_TOKEN
Responses
200

OK

400

Bad request: No project named x

get/project/exportProjectData
Response samples
application/json
{ }

Get Project ID

This API returns the projectId for a given project. The project’s name is required to retrieve the ID.

Request
query Parameters
projectName
required
string

Name of the Project

Example: projectName=eportal
header Parameters
Authorization
required
string
Default:

Bearer JWT Token

Example: Bearer JWT_TOKEN
Responses
200

OK

400

Bad request: The project name entered was not found

get/project/id
Response samples
application/json
0
0

Get Project Inventory

This API retrieves a list of inventory items and their details for a given project (identified by its inventoryId). You have the option hide all inventory information. Additionally, you can filter the list by several project attributes.

All project users are permitted to use this API to view project inventory, including that of private projects.

Request
path Parameters
projectId
required
integer <int32>

ID of the Project

Example: 1
query Parameters
skipVulnerabilities
boolean
Default: false

If true, hide vulnerability details in the response.

published
string
Default: "true"

If true, then only published inventory items are returned; if false, then only not-published inventory items are returned

Example: published=true | default: true
vendor
string

CPE Vendor name

Example: vendor=gnu
product
string

CPE Product name

Example: product=zlib
size
integer <int32>
Default: 100

Page Size. Number Of Records to fetch per page

Example: size=1 | default: 100
page
integer <int32>
Default: 1

Page Number. Index of the page to start with(starts from 1)

Example: page=1 | default: 1
reviewStatus
string

return items based on the reviewStatus which we selected. Ex: if reviewStatus is APPROVED then only APPROVED items returned

Enum: "READY_TO_REVIEW" "DRAFT" "APPROVED" "REJECTED"
Example: reviewStatus=APPROVED
alerts
string

Return items based the alert status selected. If alert status selected as OPEN, then only open alerts are returned.

Enum: "OPEN" "CLOSED" "ANY"
Example: alerts=OPEN
header Parameters
Authorization
required
string
Default:

Bearer JWT Token

Example: Bearer JWT_TOKEN
Responses
200

OK

400

Bad request: The project Id entered was not found

get/project/inventory/{projectId}
Response samples
application/json
{
  • "name": "git",
  • "priority": {
    },
  • "id": "1",
  • "owner": "antlr",
  • "workflowURL": "string",
  • "closedVulnerabilityAlerts": [
    ],
  • "openVulnerabilityAlerts": [
    ],
  • "vulnerabilityAlerts": [
    ],
  • "asFoundLicenseText": "Sample from file LICENSE.txt in file ePortal-2.0",
  • "repositoryItem": {
    },
  • "parentGroupId": 0,
  • "autoStatus": "DRAFT",
  • "links": [