Get snippets

gethttps://app.fossa.com/api/revisions/{locator}/snippets

Retrieve snippets detected in a revision with filtering, sorting, and pagination support.

Path parameters

locatorstringrequired

The revision locator

Query parameters

pathstringrequired

The path to filter snippets by

idsstring[]

Filter by specific snippet IDs

packageIdsstring[]

Filter by specific snippet package IDs

searchstring

Search 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 |

sortenum

Sort order for results

package_ascpackage_descmatchCount_ascmatchCount_desc
pageinteger

The specific page of data to return

pageSizeinteger

The number of items to return in each page of results

Responses

200Successfully retrieved snippets
resultsobject[]required

Array of snippets

idstringrequired

Unique identifier for the snippet

packageIdstringrequired

Unique identifier for the snippet package

purlstringrequired

Package URL (purl) for the snippet

locatorstringrequired

The locator for the snippet (optional)

packagestringrequired

Name of the package containing the snippet

versionstringrequired

Version of the package

kindenumrequired

Type of snippet detection (snippet=partial match, file=100% match)

snippetfile
matchCountintegerrequired

Total number of matches for this snippet

highestMatchPercentagenumberrequired

The 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[]required

Array of licenses associated with the snippet

signaturestringrequired

License signature or identifier

typeenumrequired

How the license was identified

declareddiscovered
statusenum

Approval status of the license (optional; absent for licenses with no issue)

deniedflaggedunknown
issueIdinteger

ID of the related issue (optional)

issueCountsobjectrequired

Issue counts by type

licensingobject
deniedintegerrequired

Number of denied issues

flaggedintegerrequired

Number of flagged issues

unknownintegerrequired

Number of unknown issues

securityobject
criticalintegerrequired

Number of critical issues

highintegerrequired

Number of high issues

mediumintegerrequired

Number of medium issues

lowintegerrequired

Number of low issues

unknownintegerrequired

Number of unknown severity issues

rejectionDetailsobject
rejectedAtstring <date-time>required

Timestamp when the snippet was rejected

rejectedBystring

User who rejected the snippet (optional)

labelsobject[]required

Package labels assigned to this snippet

idintegerrequired

The ID of the package label assignment.

createdAtstring <date-time>required

The date and time the package label assignment was created.

updatedAtstring <date-time>required

The date and time the package label assignment was last updated.

organizationIdintegerrequired

The ID of the organization that owns the package label assignment.

labelIdintegerrequired

The ID of the label that was assigned to the package.

packageIdstringrequired

The ID of the package that the label was assigned to.

packageVersionstring

The version of the package that the label was assigned to or null if the label was assigned to all versions.

scopeenumrequired

The scope of the package label assignment.

orgprojectrevision
scopeIdstringrequired

The ID of the scope that the label was assigned to or null if the label was assigned to all scopes.

namestringrequired

The name of the label that was assigned to the package.

isVendoredbooleanrequired

Whether the snippet exists as a vendored dependency

isConvertedbooleanrequired

Whether the snippet has been converted to a vendored dependency

totalCountintegerrequired

Total number of snippets matching the filter criteria

pageintegerrequired

Current page number

pageSizeintegerrequired

Number of items requested per page

400Bad Request
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

401Unauthorized
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

403Forbidden
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

404NotFound
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

Try this endpoint

Build a request and run it against app.fossa.com.

Bearer

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/snippets
curl --request GET \  --url 'https://app.fossa.com/api/revisions/%7Blocator%7D/snippets' \  --header 'accept: application/json'

Real request. Mutating methods can change data.

Click Try It to run a request and see the response here.
Missing path params: locator

Path params

locatorstringrequired

The revision locator

Query params

pathstringrequired

The path to filter snippets by

idsarray

Filter by specific snippet IDs

packageIdsarray

Filter by specific snippet package IDs

searchstring

Search term for filtering snippets by package name

rejectionStatusarray

Filter by rejection status

packageLabelsarray

Filter by package labels

vendoredMatcharray

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 |

sortenum

Sort order for results

pageinteger

The specific page of data to return

pageSizeinteger

The number of items to return in each page of results