Legal REST API
Use this REST API to manage Notice files and License files for a component.
Methods Supported:
GET
POST
GET Legal Files
Use this method to retrieve all Legal files for a component, by specifying the component identifier and the required legal file type (License or Notice).
GET /api/experimental/licenseLegalMetadata/{ownerType: application|organization}/{ownerId}/component/legalFile
Example:
curl -u username:password 'http://localhost:8070/api/experimental/licenseLegalMetadata/application/client-frameworks/component/legalFile?componentIdentifier=%7B%22format%22%3A%22pypi%22%2C%22coordinates%22%3A%7B%22extension%22%3A%22whl%22%2C%22name%22%3A%22anyio%22%2C%22qualifier%22%3A%22py3-none-any%22%2C%22version%22%3A%223.6.1%22%7D%7D&legalFileType=license' -H 'Accept: application/json, text/plain, */*'
The response contains all legal files of the specified type (license or notice) for the given component identifier.
Update Legal Files
Use the POST method to update the legal files with the specified text content for a given component identifier.
POST /api/experimental/licenseLegalMetadata/{ownerType: application|organization}/{ownerId}/component/legalFile
Example:
curl -u username:password 'http://localhost:8070/api/experimental/licenseLegalMetadata/organization/ROOT_ORGANIZATION_ID/component/legalFile?timestamp=1741718814750' -H 'Accept: application/json, text/plain, */*' -H 'Content-Type: application/json' --data-raw '{"id":null,"legalFileType":"license","componentIdentifier":{"format":"pypi","coordinates":{"extension":"whl","name":"anyio","qualifier":"py3-none-any","version":"3.6.1"}},"legalFileOverrides":[{"id":null,"originalContentHash":"5361ac9dc58f2ef5fd2e9b09c68297c17f04950909bbc8023bdb82eacf22c2b0","content":"The MIT License (MIT)\n\nCopyright (c) 2018 Alex Grönholm\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","status":"enabled"},{"id":null,"originalContentHash":"5361ac9dc58f2ef5fd2e9b09c68297c17f04950909bbc8023bdb82eacf22c2b0","content":"The MIT License (MIT)\n\nCopyright (c) 2018 Alex Grönholm\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","status":"enabled"},{"id":null,"originalContentHash":null,"content":"This is test license data.","status":"enabled"}]}'