Skip to main content
Version: 2608.1

Open Source Analysis Request API


POSThttps://ondemand.sparrowcloud.ai/api/v1/analysis/tool/sca

Description

To identify known vulnerabilities or license-related problems in open source software, users can send an API request and receive a response about the status of that request.

Request

You need a. the repository location of the files to be analyzed and, if required, the credentials for that repository, and b. the callback URL information to which the analysis results will be delivered. See Request and fill in the API accordingly.

Response

Immediately after you send the analysis request, you receive a success or failure response. For details, see Response for the open source analysis request API.

Callback

Depending on the callback information entered in the request, you receive a progress callback or an analysis completion callback. For details, see Callback.

:::info For information about the analysis request process, see Analysis requests and callbacks. :::

{
"resultVersion": `2`,
"callbacks": [
{
"type": [
"ANALYSIS_COMPLETE"
],
"url": "CALLBACK_URL",
"headers": [
{
"key": "HEADER_KEY",
"value": "HEADER_VALUE"
}
]
}
],
"memo": "MEMO",
"scaOptions": {
"maxSourceSize": "SOURCE_SIZE",
"analysisSource": {
"type": "VCS",
"vcsInfo": {
"type": "git",
"url": "VCS_URL",
"auth": {
"id": "VCS_ID",
"password": "VCS_PASSWORD",
"authToken": "VCS_TOKEN"
},
"branch": "BRANCH_NAME",
"commitId": "COMMIT_ID",
"tag": "TAG_NAME"
}
},
"extensions": ["FILE_EXTENSION1", "FILE_EXTENSION2"],
"excludedPath": ["EXCLUDED_PATH1", "EXCLUDED_PATH2", "EXCLUDED_PATH3"]
}
}

Request body

Response

✔️ Success response

Request succeeded

When the analysis request is processed normally, you receive 200 OK together with the following response.

{
"requestId": "REQUEST_ID",
"result": "SUCCESS",
"analysisList": [
{
"analysisId": "ANALYSIS_ID",
"reqestId": "REQUEST_ID",
"status": "INIT",
"toolType": "SCA",
"memo": "MEMO"
}
]
}

❌ Failure response

Authentication failure

If the credentials are incorrect, you receive a 401 Unauthorized response.

Bad request

For a bad request, you receive a 400 Bad Request response together with the following information.

  • resultCode: indicates the result of the request as a code. For details, see API result codes.
  • message: shows the error message.

Callback

✅ Analysis status callback

{
"analysisId": "ANALYSIS_ID"
"requestId": "REQUEST_ID"
"type": "ANALYSIS_PROGRESS"
"status": "PRE_PROCESS"
"progress": null
"step": "STEP"
"totalStep": 5
"updateTime": "YYYY-MM-DDTHH:mm:ss.SSS±HH:mm"
}

☑️ Analysis completion callback

{
"analysisId": "ANALYSIS_ID"
"requestId": "REQUEST_ID"
"type": "ANALYSIS_COMPLETE"
"errorCode": null
"analysis": {
"analysisId": 2992
"requestId": 3837
"status": "COMPLETE"
"result": "SUCCESS"
"progress": null
"toolType": "SCA"
"memo": "MEMO"
"startTime": "YYYY-MM-DDTHH:mm:ss.SSS±HH:mm"
"endTime": "YYYY-MM-DDTHH:mm:ss.SSS±HH:mm"
"issueCount": "TOTAL_ISSUES"
}
}