Description: Returns the requested data for the evidence file defined by the GraphQL query. Use the query to determine what data about the file is returned.
Tip
Use the Search Evidence API to return data about all the evidence files associated with a particular subject.
Since: 7.104.2
Security: Requires a valid token; requires Read permissions to the subject repository
Usage: POST /onemodel/api/v1/graphql
Sample Usage:
curl --location -X POST -H "Content-Type: application/json" -H "Authorization: Bearer *******" https://johnf.company.io/onemodel/api/v1/graphql -d '{"query":""}'
Sample query in GraphQL format (for readability):
{
evidence {
getEvidence(
repositoryKey: "commons-dev-generic-local"
path: "1/a/file.txt"
name: "code-review-1723469267345.json" ) {
name
path
projectKey
repositoryKey
downloadPath
sha256
predicateSlug
predicateCategory
predicateType
predicate
createdAt
createdBy
verified
signingKey {
alias
}
}
}
}
Sample query after conversion to JSON (for purposes of execution):
{ "query": "{ evidence { getEvidence( repositoryKey: \"commons-dev-generic-local\" path: \"1/a/file.txt\" name: \"code-review-1723469267345.json\" ) { name path projectKey repositoryKey downloadPath sha256 predicateSlug predicateCategory predicateType predicate createdAt createdBy verified publicKey { alias } } }}" }
Tip
Use a GraphQL to JSON body converter (available online) to create the proper payload for the REST API POST request. Alternatively, the GraphQL query can be used in tools such as GraphiQL.
The search query uses the following criteria to determine which evidence file to include in the response:
Property | Mandatory/Optional | Description |
---|---|---|
| optional | The project key related to the evidence file. This property is overridden by the |
| optional | The repository key related to the evidence file. If this property is not defined, the NoteIf both the |
| optional | The directory path + filename of the evidence subject. |
| optional | The filename of the evidence file. |
The search query can include one or more of the following properties, which determine the data to return from the evidence file:
Property | Description |
---|---|
| The filename of the evidence file. |
| The directory path of the evidence subject + the filename of the subject. |
| The name of the repository that contains the evidence file. |
| The full repository path of the evidence file, which can be used for downloading the file. |
| The checksum of the evidence file. |
| A simplified version of the predicateType (after removing the http:// or https:// schema, the query string, the trailing version, and the jfrog.com domain) provided for better readability. For example, the predicateType https://jfrog.com/evidence/release-bundle/v1 is shortened to release-bundle. |
| The category in which the evidence file is classified, as defined by the
|
| The URL type associated with the predicate. For more information, see Evidence Payload. |
| The contents of the claims made in the evidence file. |
| The timestamp of when the evidence file was created. |
| The user who created the evidence. |
| Whether the evidence has been verified on the server side in Artifactory using the public key. |
| The name of the public key used to verify the evidence. |
Sample response:
{ "data": { "evidence": { "getEvidence": { "name": "code-review-1723469267345.json", "path": "1/a/file.txt", "repositoryKey": "commons-dev-generic-local", "downloadPath": "commons-dev-generic-local/.evidence/f9f3100eea27f7884a9f3e6883d22191cc6cfd4a5421f2617bcf6b42f9a2f7a1/69d29925ba75eca8e67e0ad99d1132b47d599c206382049bc230f2edd2d3af30/code-review-1723469267345.json", "sha256": "e4dea090445947bf1b1657ad3f1e06948d5d9951d6ec22ded8efc056c26c4a21", "predicateSlug": "code-review", "predicateCategory": "Custom", "predicateType": "https://jfrog.com/evidence/code-review/v0.1", "predicate": { "commiter": "Dennis Sheridan", "review-result": "PASSED", "reviewLink": "https://git.jfrog.com/commons/abc", "reviewer": "Mickey Keller", "timestamp": "2030-01-01T00:00:00.000Z" }, "createdAt": "2025-01-01T00:00:00.000Z", "createdBy": "long-token-name", "verified": false "publicKey": { "alias": "RSA-4096" } } } } }
Status Codes:
Code | Description |
---|---|
200 | OK |
401 | Bad Credentials |
403 | Permission Denied |