Downloading Reports

You can use the API or SDK to download PDF and CSV reports.

Check out SDK examples in our Github repo here!

Using the Python SDK

To download a report for a specific Artifact Version, use the download_asset_version_report function.

import finite_state_sdk

# Access the environment variables
CLIENT_ID = os.getenv('CLIENT_ID')
CLIENT_SECRET = os.getenv('CLIENT_SECRET')
ORGANIZATION_CONTEXT = os.getenv('ORGANIZATION_CONTEXT')

TOKEN = finite_state_sdk.get_auth_token(CLIENT_ID, CLIENT_SECRET)

asset_version_id = "1234567890"  # the asset to generate the report for
report_type = "CSV"  # can be "CSV" or "PDF"
report_subtype = "ALL_FINDINGS"  # can be "ALL_FINDINGS", "ALL_COMPONENTS", "EXPLOIT_INTELLIGENCE", or "RISK_SUMMARY"

# Download a CSV report of all findings for an asset version
finite_state_sdk.download_asset_version_report(TOKEN, ORGANIZATION_CONTEXT, report_type=report_type, \
  report_subtype=report_subtype, asset_version_id=asset_version_id, \
    output_filename=f"artifact_version-all_findings.csv")

To download a report for a specific Product, use the download_product_report function.


product_id = '1234567890'  # the product to generate the report for
finite_state_sdk.download_product_report(TOKEN, ORGANIZATION_CONTEXT, report_type=report_type, \
  report_subtype=report_subtype, product_id=product_id, output_filename=f"product-all_findings.csv")