- 09 Dec 2022
- 4 Minutes to read
- Print
- DarkLight
- PDF
Report Endpoints
- Updated on 09 Dec 2022
- 4 Minutes to read
- Print
- DarkLight
- PDF
The report endpoints provide the ability to generate various reports about your projects and analyses.
Get Digests - Retrieve the data of an analysis' digests.
Get Exported Data - Retrieve a report for the specified projects.
Get Portfolio - Retrieve a team's portfolio report.
Get Project History - Returns information on the last year of analyses for a specified project.
Get Projects - Returns information on a team's projects and those projects' most recent analysis.
Get SBOM - Retrieve an SBOM for one or more projects in a team.
Get Vulnerability List - Returns information on all vulnerabilities affecting a team's projects.
Get Digests
The v1/project/getDigests endpoint allows you to retrieve the digest of an analysis of a single project. The digest contains data used by the UI to display the results of an analysis.
Endpoint | |
v1/report/getDigests | |
Request Method | |
GET | |
Parameter | Description |
id | The analysis ID. |
team_id | The team ID. |
project_id | The project ID. |
grouped | Either "true" or "false". True will group like digests together. |
Request Example
curl -H "Authorization: Bearer TOKEN" \
"https://api.ionchannel.io/v1/report/getDigests?id=ANALYSIS_ID&team_id=TEAM_ID&project_id=PROJECT_ID&grouped=true"
Response Example
Get Exported Data
The v1/report/getExportedData endpoint retrieves a summary report for the most recent analysis of the specified projects. This report includes the project name, product details, most recent analysis status, vulnerability count, and virus count.
Endpoint | |
v1/report/getExportedData | |
Request Method | |
POST | |
Parameter | Description |
ids | An array of project IDs. |
team_id | Your team ID. |
Request Example
curl -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer TOKEN" \
-d '{
"team_id":"TEAM_ID",
"ids": [
"PROJECT_ID_1",
"PROJECT_ID_2"
]
}' \
"https://api.ionchannel.io/v1/report/getExportedData"
Response Example
{
"data": {
"created_at": "2021-02-06T00:26:30.915885697Z",
"projects": [
{
"project_name": "Ion Connect",
"project_id": "abcd1234-ab12-ab12-ab12-abcde123456",
"product_name": "",
"version": "",
"org": "",
"current_status": "passed",
"vuln_count": 0,
"critical_vuln_count": 0,
"high_vuln_count": 0,
"virus_count": 0
},
{
"project_name": "anion",
"project_id": "1234abcd-ab12-ab12-ab12-abcde123456",
"product_name": "",
"version": "",
"org": "",
"current_status": "passed",
"vuln_count": 0,
"critical_vuln_count": 0,
"high_vuln_count": 0,
"virus_count": 0
}
]
},
"meta": {
"total_count": 2,
"offset": 0,
"last_update": "2021-02-06T00:26:30.915885886Z"
}
}
Get Portfolio
The v1/report/getPortfolio endpoint returns the portfolio report for a given team.
Endpoint | |
v1/report/getPortfolio | |
Request Method | |
GET | |
Parameter | Description |
id | Your team ID. |
Request Example:
curl -H "Authorization: Bearer TOKEN" \
"https://api.ionchannel.io/v1/report/getPortfolio?id=TEAM_ID"
Response Example:
Get Project History
The v1/report/getProjectHistory endpoint returns details of all of a project's analyses performed in the past year. These details include the date of the analysis, whether the analysis passed or failed, and whether the status of the analysis changed from the previous analysis.
Endpoint | |
v1/report/getProjectHistory | |
Request Method | |
GET | |
Parameter | Description |
team_id | Your team ID. |
project_id | The project ID. |
Request Example:
curl -H "Authorization: Bearer TOKEN" \
https://api.ionchannel.io/v1/report/getProjectHistory?team_id=TEAM_ID&project_id=PROJECT_ID
Response Example:
{
"data": [
{
"date": "2021-05-14T00:00:00Z",
"project_pass_fail": {
"team_id": "abcd1234-ab12-ab12-ab12-abcde123456",
"project_id": "abcd1234-ab12-ab12-ab12-abcde123456",
"analysis_id": "abcd1234-ab12-ab12-ab12-abcde123456",
"pass": true,
"fail_count": 0,
"created_at": "2021-05-14T17:36:29.99703Z",
"status_flipped": false
}
},
{
"date": "2021-04-29T00:00:00Z",
"project_pass_fail": {
"team_id": "abcd1234-ab12-ab12-ab12-abcde123456",
"project_id": "abcd1234-ab12-ab12-ab12-abcde123456",
"analysis_id": "abcd1234-ab12-ab12-ab12-abcde123456",
"pass": true,
"fail_count": 0,
"created_at": "2021-04-29T23:54:06.205726Z",
"status_flipped": false
}
}
],
"meta": {
"total_count": 2,
"offset": 0,
"last_update": "2021-05-14T17:37:09.649706527Z"
}
}
Get Projects
The v1/report/getProjects endpoint returns details on all of the projects in a team and those projects' most recent analysis details.
Endpoint | |
v1/report/getProjects | |
Request Method | |
GET | |
Parameter | Description |
team_id | Your team ID. |
Request Example:
curl -H "Authorization: Bearer TOKEN" \
https://api.ionchannel.io/v1/report/getProjects?team_id=TEAM_ID
Response Example:
{
"data": [
{
"id": "bcde1234-ab12-ab12-ab12-abcde234567",
"team_id": "abcd1234-ab12-ab12-ab12-abcde123456",
"name": "Project Name",
"active": true,
"draft": false,
"chat_channel": "",
"created_at": "2022-12-07T23:28:06.380336Z",
"updated_at": "2022-12-07T23:28:06.380336Z",
"deploy_key": "",
"should_monitor": true,
"monitor_frequency": "",
"poc_name": "",
"poc_email": "",
"username": "",
"password": "",
"key_fingerprint": "",
"private": false,
"aliases": null,
"tags": null,
"ruleset_history": null,
"sbom_id": "",
"sbom_entry_id": "",
"cpe": "",
"purl": "",
"ruleset_name": "Default",
"analysis_summary": {
"id": "defg1234-ab12-ab12-ab12-abcde345678",
"analysis_id": "efgh1234-ab12-ab12-ab12-abcde3456789",
"team_id": "",
"project_id": "",
"name": "",
"text": null,
"type": "",
"source": "",
"branch": "",
"description": "",
"risk": "high",
"summary": "",
"passed": false,
"ruleset_id": "effe0a9c-2d60-4c5b-9098-98d198295138",
"ruleset_name": "Default",
"status": "",
"created_at": "2021-08-24T23:28:11.971603Z",
"updated_at": "0001-01-01T00:00:00Z",
"duration": 86.759953,
"trigger_hash": "",
"trigger_text": "",
"trigger_author": "",
"trigger": "source commit"
},
"status": "failing"
}
],
"meta": {
"total_count": 1,
"limit": 1000,
"offset": 0
}
}
Get SBOM
The v1/reports/getSBOM endpoint generates and returns JSON that includes an SBOM for the specified projects in SPDX or CycloneDX formats.
Endpoint | |
v1/report/getSBOM | |
Request Method | |
POST | |
Parameter | Description |
ids | An array of project IDs. |
team_id | Your team ID. |
sbom_type | The type of SBOM to export. Valid values are SPDX or CycloneDX. Will return the SBOM in Ion Channel JSON format if not specified. |
include_dependencies | Designates if a project's dependencies should be included in the file. Valid values are true or false. |
team_top_level | Designates if the top-level components should be the Ion Channel team name. The team name will be used as the top-level component if set to true. If set to false, the project name will be set as the top-level component. This should always be set to true when including multiple projects in the SBOM. |
Request Example
curl -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer TOKEN" \
-d '{
"team_id": "abcd1234-ab12-ab12-ab12-abcde123456",
"ids": [
"bcde1234-ab12-ab12-ab12-abcde234567",
"cdef1234-ab12-ab12-ab12-abcde345678"
]
}' \
"https://api.ionchannel.io/v1/report/getSBOM?sbom_type=SPDX&include_dependencies=false&team_top_level=true"
Response Example
{
"data": "##Document Header\nSPDXVersion: SPDX-2.2\nDataLicense: CC0-1.0\nSPDXID: SPDXRef-DOCUMENT\nDocumentName: Ion Channel SBOM Export\nDocumentNamespace: https://ionchannel.io\nCreator: Organization: Ion Channel\nCreated: 2022-01-05T00:52:59Z\nCreatorComment: <text>SBOM document in SPDX format generated by Ion Channel.</text>\n\n\n##\n## Packages\n##\n\nPackageName: ion-channel\nSPDXID: SPDXRef-ion-channel\nPackageVersion: NOASSERTION\nPackageSupplier: NOASSERTION\nRelationship: SPDXRef-DOCUMENT DESCRIBES SPDXRef-ion-channel\nPackageDownloadLocation: NOASSERTION\nFilesAnalyzed: false\nPackageLicenseConcluded: NOASSERTION\nPackageLicenseDeclared: NOASSERTION\nPackageCopyrightText: NOASSERTION\n\n\n\n\nPackageName: Ion Connect\nSPDXID: SPDXRef-Ion-Connect\nExternalRef: PERSISTENT-ID swh swh:1:rev:c277f2bcf86702314601b22c5ae95ac328090a85\nPackageVersion: NOASSERTION\nPackageSupplier: NOASSERTION\nRelationship: SPDXRef-ion-channel DEPENDS_ON SPDXRef-Ion-Connect\nPackageDownloadLocation: git+git@github.com:ion-channel/ion-connect.git@master\nFilesAnalyzed: true\nPackageLicenseConcluded: NOASSERTION\nPackageLicenseDeclared: Apache-2.0\nPackageCopyrightText: NOASSERTION\n\n\n\n\n\n",
"meta": {
"total_count": 1,
"offset": 0,
"last_update": "2022-01-05T00:52:59.769035479Z"
}
}
Get Vulnerability List
The v1/report/getVulnerabilityList endpoint returns a list of all vulnerabilities affecting a team's projects.
Endpoint | |
v1/report/getVulnerabilityList | |
Request Method | |
GET | |
Parameter | Description |
id | Your team ID. |
Request Example
curl -H "Authorization: Bearer TOKEN" \
"https://api.ionchannel.io/v1/report/getVulnerabilityList?id=TEAM_ID"
Response Example
{
"data": {
"cve_list": [
{
"title": "CVE-2020-25032",
"projects_affected": 1,
"product": "flask-cors",
"rating": 7.5,
"system": "cvssv3.1"
},
{
"title": "CVE-2018-18074",
"projects_affected": 1,
"product": "requests",
"rating": 7.5,
"system": "cvssv3.1"
},
{
"title": "CVE-2021-28363",
"projects_affected": 3,
"product": "urllib3",
"rating": 6.5,
"system": "cvssv3.1"
}
]
},
"meta": {
"total_count": 0,
"offset": 0
}
}