Artifact Latest Version Search Based on Properties

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

Description: Search for artifacts with the latest value in the version property. Only artifacts with the version property expressly defined in lowercase will be returned.

Note that this API is based on a Maven-specific algorithm for sorting versions. For more information on sorting rules, see Version Rules.

Notes: Requires Artifactory Pro

Results can be filtered by specifying additional properties.

  • {repo}: Specify a repository to search through or replace with "_any" to search through all repositories

  • {path}: Specify a path to search through or replace with "_any" to search through all paths

  • listFiles=0 (default): Artifactory will only retrieve the latest version

  • listFiles=1: Artifactory will retrieve the latest version and the corresponding files

You may specify filters to restrict the set of artifacts that are searched by adding any properties to your search URL.

Since: 3.1.1

Security: Requires an authenticated user (not anonymous) to use the api and read permission to the repository of each artifact.

Usage: GET /api/versions/{repo}/{path}?[listFiles=0/1]&[<property key>=<property value>]&[<property key>=<property value>]

Consumes: json

Examples:

Return the latest version and corresponding artifacts by searching for through all repositories whose path starts with a/b and are annotated with the properties os=win and license=GPL. 
GET /api/versions/_any/a/b?os=win&license=GPL&listFiles=1
{
   "version" : "1.1.2",
   "artifacts" : [ {
        "uri" : "http://...."
   }]
}
 
Return the latest version (without the corresponding artifacts) by searching through all repositories whose path starts with a/b and are annotated with the properties os=win and license=GPL. 
Return only the version.
GET /api/versions/_any/a/b?os=win&license=GPL
{
   "version" : "1.1.2",
   "artifacts" : []
}