Option 3: Using Chrome Developer Tools

XRAY: Troubleshooting "Component is not found for given SHA" Error in exportDetails REST-API

AuthorFullName__c
Bassel Mbariky
articleNumber
000005992
FirstPublishedDate
2024-01-22T07:22:45Z
lastModifiedDate
2024-01-21
VersionNumber
1
Follow these steps:
  • Navigate to the file on the UI.
  • Open the developer tools.
  • Go to the network section.
  • Click on "Xray" as demonstrated.
  • Open the aboutBox in the Developer tools and use the component ID as the component name.
User-added image

After retrieving the correct component name, now we can run the Rest API with or without the SHA-256 using the component name, example below:
curl -uadmin:password -XPOST -H "Content-Type: application/json" <artifactory-url>/xray/api/v1/component/exportDetails -d '{"license": true, "security": true, "exclude_unknown": true,"component_name": "mysql:mysql-connector-java:5.1.41","package_type": "maven", "output_format": "json_full" }' -o  sbom_output.json

For more information on how Xray generate component name please refer to the following In Component Identifier page.