Source Link REST API
Use this REST API to specify the links to the original source code files for the component.
Methods Supported:
POST
Add a Link to the Original Source Code
Use the POST method to add a links to the original source code files for a component by specifying the component identifier.
POST /api/experimental/licenseLegalMetadata/{ownerType: application|organization}/{ownerId}/component/sourceLink
Example:
curl -u username:password 'http://localhost:8070/api/experimental/licenseLegalMetadata/application/client-frameworks/component/sourceLink?timestamp=1741719326918' -H 'Accept: application/json, text/plain, */*' -H 'Content-Type: application/json' --data-raw $'{"componentIdentifier":{"format":"pypi","coordinates":{"extension":"whl","name":"anyio","qualifier":"py3-none-any","version":"3.6.1"}},"packageUrl":"pkg:pypi/anyio@3.6.1?extension=whl&qualifier=py3-none-any","sourceLinkOverrides":[{"content":"https://pypi.org/project/anyio/3.6.1","id":null,"originalContent":"https://pypi.org/project/anyio/3.6.1","status":"enabled"},{"content":"This is a source link\u0021","id":null,"status":"enabled"}]}'
Setting the status to enabled
will allow the source code links to be included in the attribution report.