Get snippets
https://app.fossa.com/api/revisions/{locator}/snippetsRetrieve snippets detected in a revision with filtering, sorting, and pagination support.
Path parameters
locatorstringrequiredThe revision locator
Query parameters
pathstringrequiredThe path to filter snippets by
idsstring[]Filter by specific snippet IDs
packageIdsstring[]Filter by specific snippet package IDs
searchstringSearch term for filtering snippets by package name
rejectionStatusenum[]Filter by rejection status
packageLabelsstring[]Filter by package labels
vendoredMatchenum[]Filter snippets by vendored/converted match status. Accepts one or more of: | Value | Description | |-------|-------------| | `vendored` | Include snippets that exist as a vendored dependency | | `exVendored` | Exclude snippets that exist as a vendored dependency | | `converted` | Include snippets that have been converted to vendored dependencies | | `exConverted` | Exclude snippets that have been converted to vendored dependencies |
sortenumSort order for results
package_ascpackage_descmatchCount_ascmatchCount_descpageintegerThe specific page of data to return
pageSizeintegerThe number of items to return in each page of results
Responses
200Successfully retrieved snippetsresultsobject[]requiredArray of snippets
idstringrequiredUnique identifier for the snippet
packageIdstringrequiredUnique identifier for the snippet package
purlstringrequiredPackage URL (purl) for the snippet
locatorstringrequiredThe locator for the snippet (optional)
packagestringrequiredName of the package containing the snippet
versionstringrequiredVersion of the package
kindenumrequiredType of snippet detection (snippet=partial match, file=100% match)
snippetfilematchCountintegerrequiredTotal number of matches for this snippet
highestMatchPercentagenumberrequiredThe highest match percentage across all matches
releaseDatestring <date-time>Release date of the package (optional)
homeUrlstring <uri>Homepage URL of the package (optional)
codeUrlstring <uri>Source code URL of the package (optional)
licensesobject[]requiredArray of licenses associated with the snippet
signaturestringrequiredLicense signature or identifier
typeenumrequiredHow the license was identified
declareddiscoveredstatusenumApproval status of the license (optional; absent for licenses with no issue)
deniedflaggedunknownissueIdintegerID of the related issue (optional)
issueCountsobjectrequiredIssue counts by type
licensingobjectdeniedintegerrequiredNumber of denied issues
flaggedintegerrequiredNumber of flagged issues
unknownintegerrequiredNumber of unknown issues
securityobjectcriticalintegerrequiredNumber of critical issues
highintegerrequiredNumber of high issues
mediumintegerrequiredNumber of medium issues
lowintegerrequiredNumber of low issues
unknownintegerrequiredNumber of unknown severity issues
rejectionDetailsobjectrejectedAtstring <date-time>requiredTimestamp when the snippet was rejected
rejectedBystringUser who rejected the snippet (optional)
labelsobject[]requiredPackage labels assigned to this snippet
idintegerrequiredThe ID of the package label assignment.
createdAtstring <date-time>requiredThe date and time the package label assignment was created.
updatedAtstring <date-time>requiredThe date and time the package label assignment was last updated.
organizationIdintegerrequiredThe ID of the organization that owns the package label assignment.
labelIdintegerrequiredThe ID of the label that was assigned to the package.
packageIdstringrequiredThe ID of the package that the label was assigned to.
packageVersionstringThe version of the package that the label was assigned to or null if the label was assigned to all versions.
scopeenumrequiredThe scope of the package label assignment.
orgprojectrevisionscopeIdstringrequiredThe ID of the scope that the label was assigned to or null if the label was assigned to all scopes.
namestringrequiredThe name of the label that was assigned to the package.
isVendoredbooleanrequiredWhether the snippet exists as a vendored dependency
isConvertedbooleanrequiredWhether the snippet has been converted to a vendored dependency
totalCountintegerrequiredTotal number of snippets matching the filter criteria
pageintegerrequiredCurrent page number
pageSizeintegerrequiredNumber of items requested per page
400Bad RequestuuidstringUnique identifier associated with the error
codeintegerfossa specific error code
messagestringmessage associated with this error
namestringname of the error
httpStatusCodeintegerhttp status code number
401UnauthorizeduuidstringUnique identifier associated with the error
codeintegerfossa specific error code
messagestringmessage associated with this error
namestringname of the error
httpStatusCodeintegerhttp status code number
403ForbiddenuuidstringUnique identifier associated with the error
codeintegerfossa specific error code
messagestringmessage associated with this error
namestringname of the error
httpStatusCodeintegerhttp status code number
404NotFounduuidstringUnique identifier associated with the error
codeintegerfossa specific error code
messagestringmessage associated with this error
namestringname of the error
httpStatusCodeintegerhttp status code number
Try this endpoint
Build a request and run it against app.fossa.com.
Stored in this browser for 24 hours. Try It uses a docs proxy for CORS and does not store tokens server-side.
GET https://app.fossa.com/api/revisions/%7Blocator%7D/snippetscurl --request GET \ --url 'https://app.fossa.com/api/revisions/%7Blocator%7D/snippets' \ --header 'accept: application/json'Real request. Mutating methods can change data.
Path params
locatorstringrequiredThe revision locator
Query params
pathstringrequiredThe path to filter snippets by
idsarrayFilter by specific snippet IDs
packageIdsarrayFilter by specific snippet package IDs
searchstringSearch term for filtering snippets by package name
rejectionStatusarrayFilter by rejection status
packageLabelsarrayFilter by package labels
vendoredMatcharrayFilter snippets by vendored/converted match status. Accepts one or more of: | Value | Description | |-------|-------------| | `vendored` | Include snippets that exist as a vendored dependency | | `exVendored` | Exclude snippets that exist as a vendored dependency | | `converted` | Include snippets that have been converted to vendored dependencies | | `exConverted` | Exclude snippets that have been converted to vendored dependencies |
sortenumSort order for results
pageintegerThe specific page of data to return
pageSizeintegerThe number of items to return in each page of results